MCPcopy Index your code
hub / github.com/nodejs/node / testAbortSignal

Function testAbortSignal

test/parallel/test-stream-iter-push-basic.js:94–109  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

92}
93
94async function testAbortSignal() {
95 const ac = new AbortController();
96 const { readable } = push({ signal: ac.signal });
97
98 ac.abort();
99
100 await assert.rejects(
101 async () => {
102 // eslint-disable-next-line no-unused-vars
103 for await (const _ of readable) {
104 assert.fail('Should not reach here');
105 }
106 },
107 { name: 'AbortError' },
108 );
109}
110
111async function testPreAbortedSignal() {
112 const { readable } = push({ signal: AbortSignal.abort() });

Callers 1

Calls 3

abortMethod · 0.95
pushFunction · 0.70
failMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…