()
| 71 | } |
| 72 | |
| 73 | async function testShareCancel() { |
| 74 | const shared = share(from('data')); |
| 75 | const consumer = shared.pull(); |
| 76 | |
| 77 | shared.cancel(); |
| 78 | assert.strictEqual(shared.consumerCount, 0); |
| 79 | |
| 80 | const batches = []; |
| 81 | for await (const batch of consumer) { |
| 82 | batches.push(batch); |
| 83 | } |
| 84 | assert.strictEqual(batches.length, 0); |
| 85 | } |
| 86 | |
| 87 | async function testShareCancelMidIteration() { |
| 88 | // Verify that cancel during iteration stops data flow |