From 8dbfb7317fac3fa5641a4b1a87072ec0cfbbe7d3 Mon Sep 17 00:00:00 2001 From: juergba Date: Tue, 17 Sep 2019 10:43:48 +0200 Subject: [PATCH] add event handler for Node v8 --- lib/runner.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/runner.js b/lib/runner.js index 1369960e03..5ca036f48d 100644 --- a/lib/runner.js +++ b/lib/runner.js @@ -917,6 +917,11 @@ Runner.prototype.run = function(fn) { this.on(constants.EVENT_RUN_END, function() { debug(constants.EVENT_RUN_END); process.removeListener('uncaughtException', uncaught); + process.on('uncaughtException', function(err) { + // TODO: remove this listener when Node v8 support is dropped + process.exitCode = 1; + console.error('\n', err); + }); fn(self.failures); });