From 85032b7a81c451b5c34a033d1cdf69ea25ed244b Mon Sep 17 00:00:00 2001 From: jayasankar Date: Tue, 11 Dec 2018 22:04:47 +0530 Subject: [PATCH] updated SIGINT handler - as per comments in #3570 Signed-off-by: jayasankar --- lib/cli/run-helpers.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/cli/run-helpers.js b/lib/cli/run-helpers.js index d020768aed..dc08a63ca1 100644 --- a/lib/cli/run-helpers.js +++ b/lib/cli/run-helpers.js @@ -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')); }); };