Files
Kmake/test/fixtures/test-runner/aborts/failed-test-still-call-abort.js
2026-05-26 23:36:42 -07:00

26 lines
580 B
JavaScript

const {test, afterEach} = require('node:test');
const assert = require('node:assert');
const { waitForAbort } = require('./wait-for-abort-helper');
let testCount = 0;
let signal;
afterEach(() => {
assert.equal(signal.aborted, false);
waitForAbort({ testNumber: ++testCount, signal });
});
test("sync", (t) => {
signal = t.signal;
assert.equal(signal.aborted, false);
throw new Error('failing the sync test');
});
test("async", async (t) => {
await null;
signal = t.signal;
assert.equal(signal.aborted, false);
throw new Error('failing the async test');
});