Skip to content

Commit

Permalink
updated SIGINT handler - as per comments in mochajs#3570
Browse files Browse the repository at this point in the history
Signed-off-by: jayasankar <jayasankar.m@gmail.com>
  • Loading branch information
Jayasankar-m committed Dec 12, 2018
1 parent 6df0e84 commit 85032b7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/cli/run-helpers.js
Expand Up @@ -204,6 +204,7 @@ exports.singleRun = (mocha, {files = [], exit = false} = {}) => {
// 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;
setImmediate(() => process.kill(process.pid, 'SIGINT'));
});
};

Expand Down

0 comments on commit 85032b7

Please sign in to comment.