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

Function testPullWithAbortSignal

test/parallel/test-stream-iter-pull-async.js:43–58  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

41}
42
43async function testPullWithAbortSignal() {
44 async function* gen() {
45 yield [new Uint8Array([1])];
46 }
47
48 const result = pull(gen(), { signal: AbortSignal.abort() });
49 await assert.rejects(
50 async () => {
51 // eslint-disable-next-line no-unused-vars
52 for await (const _ of result) {
53 assert.fail('Should not reach here');
54 }
55 },
56 { name: 'AbortError' },
57 );
58}
59
60async function testPullChainedTransforms() {
61 const enc = new TextEncoder();

Callers 1

Calls 4

pullFunction · 0.70
genFunction · 0.70
abortMethod · 0.65
failMethod · 0.45

Tested by

no test coverage detected