node/test/fixtures/test-runner/plan/timeout-wait-false.mjs
Pietro Marchini 1b655c7631
test: test runner run plan
PR-URL: https://github.com/nodejs/node/pull/57304
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2025-03-10 22:23:23 +00:00

11 lines
353 B
JavaScript

import test from 'node:test';
test('should not wait for assertions and fail immediately', async (t) => {
t.plan(1, { wait: false });
// Set up an async operation that won't complete before the test finishes
// Since wait:false, the test should fail immediately without waiting
setTimeout(() => {
t.assert.ok(true);
}, 1000).unref();
});