Skip to content

armgit / mocha

Public Imported from GitHub
0

☕️ Classic, reliable, trusted test framework for Node.js and the browser

do not recursively call `process.exit()` (#3684)

Anna Henningsen0f95a7d73355
diff --git a/.travis.yml b/.travis.yml
index 02d4c471..2de2a30c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -11,7 +11,7 @@ stages:
# defaults
language: node_js
-node_js: '11.6'
+node_js: '11'
addons:
apt:
packages:
diff --git a/lib/cli/run-helpers.js b/lib/cli/run-helpers.js
index df53117f..d953a069 100644
--- a/lib/cli/run-helpers.js
+++ b/lib/cli/run-helpers.js
@@ -25,7 +25,7 @@ const cwd = (exports.cwd = process.cwd());
*/
const exitMochaLater = code => {
process.on('exit', () => {
- process.exit(Math.min(code, 255));
+ process.exitCode = Math.min(code, 255);
});
};