File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
packages/vest/src/core/suite Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -32,13 +32,13 @@ export type Suite<T extends CB> = {
3232 * });
3333 * });
3434 */
35- function create < T extends CB > ( suiteName : string , suiteCallback : T ) : Suite < T > ;
35+ function create < T extends CB > ( suiteName : SuiteName , suiteCallback : T ) : Suite < T > ;
3636function create < T extends CB > ( suiteCallback : T ) : Suite < T > ;
3737// eslint-disable-next-line max-lines-per-function
3838function create < T extends CB > (
39- ...args : [ suiteName : string , suiteCallback : T ] | [ suiteCallback : T ]
39+ ...args : [ suiteName : SuiteName , suiteCallback : T ] | [ suiteCallback : T ]
4040) : Suite < T > {
41- const [ suiteCallback , suiteName ] = args . reverse ( ) as [ T , string ] ;
41+ const [ suiteCallback , suiteName ] = args . reverse ( ) as [ T , SuiteName ] ;
4242
4343 invariant (
4444 isFunction ( suiteCallback ) ,
@@ -101,3 +101,5 @@ function create<T extends CB>(
101101}
102102
103103export default create ;
104+
105+ export type SuiteName = string | void ;
Original file line number Diff line number Diff line change 11import { cache as createCache , assign } from 'vest-utils' ;
22
3+ import { SuiteSummary } from 'SuiteSummaryTypes' ;
4+ import { SuiteName } from 'create' ;
35import ctx from 'ctx' ;
46import genTestsSummary from 'genTestsSummary' ;
57import { useStateRef , useTestsFlat , useSuiteName } from 'stateHooks' ;
@@ -24,4 +26,5 @@ export function produceSuiteResult(): SuiteResult {
2426 ) ;
2527}
2628
27- export type SuiteResult = ReturnType < typeof genTestsSummary > & SuiteSelectors ;
29+ export type SuiteResult = SuiteSummary &
30+ SuiteSelectors & { suiteName : SuiteName } ;
You can’t perform that action at this time.
0 commit comments