File tree 1 file changed +12
-10
lines changed
1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -256,10 +256,10 @@ describe('test runner watch mode', () => {
256
256
} ) ;
257
257
assert . notDeepStrictEqual ( durations [ 0 ] [ 1 ] , durations [ 1 ] [ 1 ] ) ;
258
258
} ) ;
259
-
259
+
260
260
it ( 'should emits test:watch:restarted when file is updated' , async ( ) => {
261
261
const testWatchRestarted = common . mustCall ( 1 ) ;
262
-
262
+
263
263
const controller = new AbortController ( ) ;
264
264
const stream = run ( {
265
265
cwd : tmpdir . path ,
@@ -270,26 +270,28 @@ describe('test runner watch mode', () => {
270
270
testWatchRestarted ( ) ;
271
271
controller . abort ( ) ;
272
272
}
273
- } )
273
+ } ) ;
274
+
275
+ await once ( stream , 'test:watch:drained' ) ;
274
276
275
277
writeFileSync ( join ( tmpdir . path , 'test.js' ) , fixtureContent [ 'test.js' ] ) ;
276
-
278
+
277
279
// eslint-disable-next-line no-unused-vars
278
280
for await ( const _ of stream ) ;
279
- } )
280
-
281
+ } ) ;
282
+
281
283
it ( 'should not emit test:watch:restarted since watch mode is disabled' , async ( ) => {
282
284
const stream = run ( {
283
285
cwd : tmpdir . path ,
284
286
watch : false ,
285
- } )
287
+ } ) ;
286
288
287
- stream . on ( 'test:watch:restarted' , common . mustNotCall ( ) )
289
+ stream . on ( 'test:watch:restarted' , common . mustNotCall ( ) ) ;
288
290
writeFileSync ( join ( tmpdir . path , 'test.js' ) , fixtureContent [ 'test.js' ] ) ;
289
-
291
+
290
292
// eslint-disable-next-line no-unused-vars
291
293
for await ( const _ of stream ) ;
292
- } )
294
+ } ) ;
293
295
294
296
describe ( 'test runner watch mode with different cwd' , ( ) => {
295
297
it (
You can’t perform that action at this time.
0 commit comments