Add test - already aborted signal

This commit is contained in:
Gyubong Lee 2022-05-03 21:25:28 +09:00
parent 33065813e2
commit 425f708555
1 changed files with 12 additions and 0 deletions

12
test.js
View File

@ -103,4 +103,16 @@ if (globalThis.AbortController !== undefined) {
name: 'AbortError'
});
});
test('already aborted signal', async t => {
const abortController = new AbortController();
abortController.abort();
await t.throwsAsync(pTimeout(delay(3000), 2000, undefined, {
signal: abortController.signal
}), {
name: 'AbortError'
});
});
}