From 3f94e687b976bdb324c2148d73087e769003f878 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Tue, 2 Mar 2021 13:44:43 -0800 Subject: [PATCH] [Fix] proper exit behavior in node v0.6 - show the summary at the end --- index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 09205fc8..19cacb38 100644 --- a/index.js +++ b/index.js @@ -73,7 +73,7 @@ function createExitHarness(conf) { process.on('exit', function (code) { // let the process exit cleanly. - if (code !== 0) { + if (typeof code === 'number' && code !== 0) { return; } @@ -86,6 +86,8 @@ function createExitHarness(conf) { } } harness.close(); + + process.removeAllListeners('exit'); // necessary for node v0.6 process.exit(code || harness._exitCode); });