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

Function testShareCancelWithReason

test/parallel/test-stream-iter-share-async.js:118–133  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

116}
117
118async function testShareCancelWithReason() {
119 const shared = share(from('data'));
120 const consumer = shared.pull();
121
122 shared.cancel(new Error('share cancelled'));
123
124 await assert.rejects(
125 async () => {
126 // eslint-disable-next-line no-unused-vars
127 for await (const _ of consumer) {
128 assert.fail('Should not reach here');
129 }
130 },
131 { message: 'share cancelled' },
132 );
133}
134
135async function testShareAbortSignal() {
136 const ac = new AbortController();

Callers 1

Calls 5

shareFunction · 0.85
fromFunction · 0.50
pullMethod · 0.45
cancelMethod · 0.45
failMethod · 0.45

Tested by

no test coverage detected