@@ -366,7 +366,8 @@ describe('running tests', () => {
366366 execEvent . stderr . emit ( 'data' , errmsg ) ;
367367 } ) ;
368368 setImmediate ( ( ) => {
369- execEvent . emit ( 'exit' , 1 , null ) ;
369+ execEvent . exitCode = 1 ;
370+ execEvent . emit ( 'exit' , execEvent . exitCode , null ) ;
370371 } ) ;
371372 setImmediate ( ( ) => {
372373 execEvent . emit ( 'close' , 1 , null ) ;
@@ -376,7 +377,8 @@ describe('running tests', () => {
376377 } else {
377378 return ( ) => { // Return function to successfully execute
378379 setImmediate ( ( ) => {
379- execEvent . emit ( 'exit' , 0 , null ) ;
380+ execEvent . exitCode = 0 ;
381+ execEvent . emit ( 'exit' , execEvent . exitCode , null ) ;
380382 } ) ;
381383 setImmediate ( ( ) => {
382384 execEvent . emit ( 'close' , 0 , null ) ;
@@ -569,16 +571,7 @@ describe('running tests', () => {
569571 }
570572
571573 sandbox . stub ( queue . _events , 'finish' ) . value ( [ validate ] ) ;
572- spawnStub . callsFake ( ( ) => {
573- setImmediate ( ( ) => {
574- execEvent . emit ( 'exit' , 0 , null ) ;
575- execEvent . exitCode = 0 ;
576- } ) ;
577- setImmediate ( ( ) => {
578- execEvent . emit ( 'close' , 0 , null ) ;
579- } ) ;
580- return execEvent ;
581- } ) ;
574+ spawnStub . callsFake ( childProcessStub ( ) ) ;
582575 queue . add ( { sha : ids [ 0 ] } ) ;
583576 } ) ;
584577
0 commit comments