@@ -183,16 +183,18 @@ describe('watch mode', { concurrency: false, timeout: 60_0000 }, () => {
183183 isReady : ( data ) => data . startsWith ( 'running' ) ,
184184 } ) ;
185185
186+ assert . strictEqual ( stderr , '' ) ;
187+ const expected = [ 'running' , `Restarting ${ inspect ( file ) } ` , 'Waiting for graceful termination...' ,
188+ 'exiting gracefully' , `Gracefully restarted ${ inspect ( file ) } ` , 'running' ] . join ( '\n' ) ;
189+
186190 // This message appearing is very flaky depending on a race between the
187191 // inner process and the outer process. it is acceptable for the message not to appear
188192 // as long as the SIGTERM handler is respected.
189193 if ( stdout . includes ( 'Waiting for graceful termination...' ) ) {
190- assert . strictEqual ( stdout , [ 'running' , `Restarting ${ inspect ( file ) } ` , 'Waiting for graceful termination...' ,
191- 'exiting gracefully' , `Gracefully restarted ${ inspect ( file ) } ` , 'running' , 'exiting gracefully' , '' ] . join ( '\n' ) ) ;
194+ assert ( stdout . startsWith ( expected ) ) ;
192195 } else {
193- assert . strictEqual ( stdout , [ 'running' , `Restarting ${ inspect ( file ) } ` , 'exiting gracefully' , 'running' , '' ] . join ( '\n' ) ) ;
196+ assert ( stdout . startsWith ( removeGraceMessage ( expected ) ) ) ;
194197 }
195- assert . strictEqual ( stderr , '' ) ;
196198 } ) ;
197199
198200 it ( 'should pass arguments to file' , async ( ) => {
0 commit comments