File tree 2 files changed +30
-1
lines changed
2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -307,8 +307,24 @@ export interface TodoDeclaration {
307
307
( title : string ) : void ;
308
308
}
309
309
310
+ export interface ForkableSerialInterface < Context = unknown > extends SerialInterface < Context > {
311
+ /** Create a new serial() function with its own hooks. */
312
+ fork ( ) : ForkableSerialInterface < Context > ;
313
+ }
314
+
315
+ export interface ForkableTestInterface < Context = unknown > extends TestInterface < Context > {
316
+ /** Create a new test() function with its own hooks. */
317
+ fork ( ) : ForkableTestInterface < Context > ;
318
+
319
+ /** Declare tests and hooks that are run serially. */
320
+ serial : ForkableSerialInterface < Context > ;
321
+ }
322
+
310
323
/** Call to declare a test, or chain to declare hooks or test modifiers */
311
- declare const test : TestInterface ;
324
+ declare const test : TestInterface & {
325
+ /** Create a new test() function with its own hooks. */
326
+ make ( ) : ForkableTestInterface ;
327
+ } ;
312
328
313
329
/** Call to declare a test, or chain to declare hooks or test modifiers */
314
330
export default test ;
Original file line number Diff line number Diff line change
1
+ import { expectType } from 'tsd' ;
2
+ import test , { ForkableTestInterface , ForkableSerialInterface } from '../experimental' ;
3
+
4
+ const foo = test . make ( ) ;
5
+ expectType < ForkableTestInterface > ( foo ) ;
6
+
7
+ const bar = foo . fork ( ) ;
8
+ expectType < ForkableTestInterface > ( bar ) ;
9
+
10
+ const baz = foo . serial . fork ( ) ;
11
+ expectType < ForkableSerialInterface > ( baz ) ;
12
+ const thud = baz . fork ( ) ;
13
+ expectType < ForkableSerialInterface > ( thud ) ;
You can’t perform that action at this time.
0 commit comments