Skip to content

Commit

Permalink
[Fix] proper exit behavior in node v0.6
Browse files Browse the repository at this point in the history
 - show the summary at the end
  • Loading branch information
ljharb committed Mar 2, 2021
1 parent 1642ae2 commit 3f94e68
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion index.js
Expand Up @@ -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;
}

Expand All @@ -86,6 +86,8 @@ function createExitHarness(conf) {
}
}
harness.close();

process.removeAllListeners('exit'); // necessary for node v0.6
process.exit(code || harness._exitCode);
});

Expand Down

0 comments on commit 3f94e68

Please sign in to comment.