diff --git a/lib/internal/test_runner/test.js b/lib/internal/test_runner/test.js index ed3eca13ffe38ce..dabe223b32e6b50 100644 --- a/lib/internal/test_runner/test.js +++ b/lib/internal/test_runner/test.js @@ -22,6 +22,7 @@ const { } = require('internal/util'); const { isPromise } = require('internal/util/types'); const { isUint32 } = require('internal/validators'); +const { setTimeout } = require('timers'); const { cpus } = require('os'); const { bigint: hrtime } = process.hrtime; const kCallbackAndPromisePresent = 'callbackAndPromisePresent'; @@ -47,7 +48,7 @@ function PromiseTimeout(promise, timeout) { kTestTimeoutFailure )), timeout).unref(); return PromiseRace([ - promise, + promise, deferred.promise, ]); } diff --git a/test/message/test_runner_output.js b/test/message/test_runner_output.js index 341675ee383722e..da73674d9460b42 100644 --- a/test/message/test_runner_output.js +++ b/test/message/test_runner_output.js @@ -331,10 +331,10 @@ test('subtest sync throw fails', async (t) => { test('timed out test', { timeout: 500 }, async (t) => { return new Promise((resolve) => { - setTimeout(resolve, 1000) + setTimeout(resolve, 1000); }); }); test('callback timed out test', { timeout: 500 }, (t, done) => { - setTimeout(done, 1000) -}); \ No newline at end of file + setTimeout(done, 1000); +});