Skip to content

Commit 3801e20

Browse files
RaynosJames Halliday
authored and
James Halliday
committed
do not call process.exit() on uncaught exception
1 parent 48a8786 commit 3801e20

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

index.js

+10
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,17 @@ function createExitHarness (conf) {
4343
if (conf.exit === false) return harness;
4444
if (!canEmitExit || !canExit) return harness;
4545

46+
var _error;
47+
48+
process.on('uncaughtException', function (err) {
49+
_error = err
50+
})
51+
4652
process.on('exit', function (code) {
53+
if (_error) {
54+
return
55+
}
56+
4757
if (!ended) {
4858
for (var i = 0; i < harness._tests.length; i++) {
4959
var t = harness._tests[i];

0 commit comments

Comments
 (0)