MCPcopy Create free account
hub / github.com/nodejs/node / testCancelableWait1

Function testCancelableWait1

test/parallel/test-timers-promises-scheduler.js:27–35  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25testWait().then(common.mustCall());
26
27async function testCancelableWait1() {
28 const ac = new AbortController();
29 const wait = scheduler.wait(1e6, { signal: ac.signal });
30 ac.abort();
31 await assert.rejects(wait, {
32 code: 'ABORT_ERR',
33 message: 'The operation was aborted',
34 });
35}
36
37testCancelableWait1().then(common.mustCall());
38

Calls 2

abortMethod · 0.95
waitMethod · 0.45

Tested by

no test coverage detected