Files
node/test/fixtures/test-runner/plan/timeout-wait-true.mjs
2025-03-10 22:23:23 +00:00

18 lines
345 B
JavaScript

import test from 'node:test';
test('should pass when assertions are eventually met', async (t) => {
t.plan(1, { wait: true });
setTimeout(() => {
t.assert.ok(true);
}, 250);
});
test('should fail when assertions fail', async (t) => {
t.plan(1, { wait: true });
setTimeout(() => {
t.assert.ok(false);
}, 250).unref();
});