From 5b63b8e5264a7b992bcabf23140470c5e724723b 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..980b3ccbbd 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 + console.error('\n', err); + process.exit(1); + }); fn(self.failures); });