From 47dcc5f325e31267fad47e2b14e27707d7db7528 Mon Sep 17 00:00:00 2001 From: Juerg B <44573692+juergba@users.noreply.github.com> Date: Tue, 26 Nov 2019 17:49:32 +0100 Subject: [PATCH] make uncaughtException test more stable (#4107) --- test/integration/fixtures/uncaught.fixture.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/integration/fixtures/uncaught.fixture.js b/test/integration/fixtures/uncaught.fixture.js index 6a2ded880c..2ef817001b 100644 --- a/test/integration/fixtures/uncaught.fixture.js +++ b/test/integration/fixtures/uncaught.fixture.js @@ -6,17 +6,17 @@ */ it('fails exactly once when a global error is thrown first', function (done) { - setTimeout(function () { + process.nextTick(function () { throw new Error('global error'); - }, 0); + }); }); it('fails exactly once when a global error is thrown second', function (done) { - setTimeout(function () { + process.nextTick(function () { done(new Error('test error')); - }, 0); + }); - setTimeout(function () { + process.nextTick(function () { throw new Error('global error'); - }, 0); + }); });