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

Function testShareDispose

test/parallel/test-stream-iter-share-coverage.js:47–55  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

45
46// Async share — Symbol.dispose cancels
47async function testShareDispose() {
48 const shared = share(from('dispose-test'));
49 const consumer = shared.pull();
50 shared[Symbol.dispose]();
51 assert.strictEqual(shared.consumerCount, 0);
52 // Consumer should yield nothing (cancelled before read)
53 const result = await text(consumer);
54 assert.strictEqual(result, '');
55}
56
57// Sync share — Symbol.dispose cancels
58async function testSyncShareDispose() {

Calls 4

shareFunction · 0.85
fromFunction · 0.50
textFunction · 0.50
pullMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…