Skip to content
This repository was archived by the owner on Dec 4, 2023. It is now read-only.

Commit f379c35

Browse files
addaleaxboneskull
authored andcommitted
do not recursively call process.exit() (mochajs#3684)
* do not recursively call `process.exit()` When inside `process.on('exit')`, calling `process.exit()` stops other `exit` event listeners from being invoked. This has lead to issues with coverage generation with `nyc` because a fallback exit detection mechanism in it that relies on internal Node.js APIs was accidentally disabled in Node v11.7.0, leaving `nyc` with no way to detect process exit. Refs: nodejs/node#25650 * Revert "pin default Node.js version to v11.6.0 in .travis.yml" This reverts commit 1abfef6.
1 parent ce8cb04 commit f379c35

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ stages:
1111

1212
# defaults
1313
language: node_js
14-
node_js: '11.6'
14+
node_js: '11'
1515
addons:
1616
apt:
1717
packages:

lib/cli/run-helpers.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const cwd = (exports.cwd = process.cwd());
2525
*/
2626
const exitMochaLater = code => {
2727
process.on('exit', () => {
28-
process.exit(Math.min(code, 255));
28+
process.exitCode = Math.min(code, 255);
2929
});
3030
};
3131

0 commit comments

Comments
 (0)