@@ -366,7 +366,8 @@ describe('running tests', () => {
366
366
execEvent . stderr . emit ( 'data' , errmsg ) ;
367
367
} ) ;
368
368
setImmediate ( ( ) => {
369
- execEvent . emit ( 'exit' , 1 , null ) ;
369
+ execEvent . exitCode = 1 ;
370
+ execEvent . emit ( 'exit' , execEvent . exitCode , null ) ;
370
371
} ) ;
371
372
setImmediate ( ( ) => {
372
373
execEvent . emit ( 'close' , 1 , null ) ;
@@ -376,7 +377,8 @@ describe('running tests', () => {
376
377
} else {
377
378
return ( ) => { // Return function to successfully execute
378
379
setImmediate ( ( ) => {
379
- execEvent . emit ( 'exit' , 0 , null ) ;
380
+ execEvent . exitCode = 0 ;
381
+ execEvent . emit ( 'exit' , execEvent . exitCode , null ) ;
380
382
} ) ;
381
383
setImmediate ( ( ) => {
382
384
execEvent . emit ( 'close' , 0 , null ) ;
@@ -569,16 +571,7 @@ describe('running tests', () => {
569
571
}
570
572
571
573
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 ( ) ) ;
582
575
queue . add ( { sha : ids [ 0 ] } ) ;
583
576
} ) ;
584
577
0 commit comments