Files
node/test/parallel/test-runner-mock-timers-with-timeout.js
Matteo Collina 8199f9c9d9 test_runner: make it compatible with fake timers
Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/59272
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Aviv Keller <me@aviv.sh>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
2026-03-22 13:07:26 +00:00

15 lines
554 B
JavaScript

'use strict';
require('../common');
const fixtures = require('../common/fixtures');
const assert = require('node:assert');
const { spawnSync } = require('node:child_process');
const { test } = require('node:test');
test('mock timers do not break test timeout cleanup', async () => {
const fixture = fixtures.path('test-runner', 'mock-timers-with-timeout.js');
const cp = spawnSync(process.execPath, ['--test', fixture], {
timeout: 30_000,
});
assert.strictEqual(cp.status, 0, `Test failed:\nstdout: ${cp.stdout}\nstderr: ${cp.stderr}`);
});