-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
16 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -196,14 +196,15 @@ exports.singleRun = (mocha, {files = [], exit = false} = {}) => { | |
mocha.files = files; | ||
const runner = mocha.run(exit ? exitMocha : exitMochaLater); | ||
|
||
process.on('SIGINT', () => { | ||
process.once('SIGINT', () => { | ||
debug('aborting runner'); | ||
runner.abort(); | ||
|
||
// This is a hack: | ||
// Instead of `process.exit(130)`, set runner.failures to 130 (exit code for SIGINT) | ||
// The amount of failures will be emitted as error code later | ||
runner.failures = 130; | ||
This comment has been minimized.
Sorry, something went wrong. |
||
setImmediate(() => process.kill(process.pid, 'SIGINT')); | ||
This comment has been minimized.
Sorry, something went wrong.
plroebuck
Author
Contributor
|
||
}); | ||
}; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Would set
process.exitCode
as well here JIC.