File tree Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Expand file tree Collapse file tree 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', () => {
256256 } ) ;
257257 assert . notDeepStrictEqual ( durations [ 0 ] [ 1 ] , durations [ 1 ] [ 1 ] ) ;
258258 } ) ;
259-
259+
260260 it ( 'should emits test:watch:restarted when file is updated' , async ( ) => {
261261 const testWatchRestarted = common . mustCall ( 1 ) ;
262-
262+
263263 const controller = new AbortController ( ) ;
264264 const stream = run ( {
265265 cwd : tmpdir . path ,
@@ -270,26 +270,28 @@ describe('test runner watch mode', () => {
270270 testWatchRestarted ( ) ;
271271 controller . abort ( ) ;
272272 }
273- } )
273+ } ) ;
274+
275+ await once ( stream , 'test:watch:drained' ) ;
274276
275277 writeFileSync ( join ( tmpdir . path , 'test.js' ) , fixtureContent [ 'test.js' ] ) ;
276-
278+
277279 // eslint-disable-next-line no-unused-vars
278280 for await ( const _ of stream ) ;
279- } )
280-
281+ } ) ;
282+
281283 it ( 'should not emit test:watch:restarted since watch mode is disabled' , async ( ) => {
282284 const stream = run ( {
283285 cwd : tmpdir . path ,
284286 watch : false ,
285- } )
287+ } ) ;
286288
287- stream . on ( 'test:watch:restarted' , common . mustNotCall ( ) )
289+ stream . on ( 'test:watch:restarted' , common . mustNotCall ( ) ) ;
288290 writeFileSync ( join ( tmpdir . path , 'test.js' ) , fixtureContent [ 'test.js' ] ) ;
289-
291+
290292 // eslint-disable-next-line no-unused-vars
291293 for await ( const _ of stream ) ;
292- } )
294+ } ) ;
293295
294296 describe ( 'test runner watch mode with different cwd' , ( ) => {
295297 it (
You can’t perform that action at this time.
0 commit comments