File tree 1 file changed +8
-3
lines changed
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -384,7 +384,7 @@ if (program.watch) {
384
384
process . on ( 'SIGINT' , function ( ) {
385
385
showCursor ( ) ;
386
386
console . log ( '\n' ) ;
387
- process . exit ( ) ;
387
+ process . exit ( 130 ) ;
388
388
} ) ;
389
389
390
390
var watchFiles = utils . files ( cwd , [ 'js' ] . concat ( program . watchExtensions ) ) ;
@@ -442,7 +442,7 @@ if (program.watch) {
442
442
443
443
function exitLater ( code ) {
444
444
process . on ( 'exit' , function ( ) {
445
- process . exit ( code ) ;
445
+ process . exit ( Math . min ( code , 255 ) ) ;
446
446
} ) ;
447
447
}
448
448
@@ -452,7 +452,7 @@ function exit(code) {
452
452
// https://github.com/visionmedia/mocha/issues/333 has a good discussion
453
453
function done ( ) {
454
454
if ( ! ( draining -- ) ) {
455
- process . exit ( code ) ;
455
+ process . exit ( Math . min ( code , 255 ) ) ;
456
456
}
457
457
}
458
458
@@ -470,6 +470,11 @@ function exit(code) {
470
470
471
471
process . on ( 'SIGINT' , function ( ) {
472
472
runner . abort ( ) ;
473
+
474
+ // This is a hack:
475
+ // Instead of `process.exit(130)`, set runner.failures to 130 (exit code for SIGINT)
476
+ // The amount of failures will be emitted as error code later
477
+ runner . failures = 130 ;
473
478
} ) ;
474
479
475
480
/**
You can’t perform that action at this time.
0 commit comments