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

Function testSyncIteratorThrow

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

Source from the content-addressed store, hash-verified

78
79// Sync consumer iterator throw()
80async function testSyncIteratorThrow() {
81 const shared = shareSync(fromSync('throw-sync'));
82 const consumer = shared.pull();
83 const iter = consumer[Symbol.iterator]();
84 const first = iter.next();
85 assert.strictEqual(first.done, false);
86 const result = iter.throw(new Error('test-throw'));
87 assert.strictEqual(result.done, true);
88 assert.strictEqual(shared.consumerCount, 0);
89}
90
91// Async source throws non-Error value → wrapError
92async function testShareSourceThrowsNonError() {

Calls 5

shareSyncFunction · 0.85
nextMethod · 0.65
fromSyncFunction · 0.50
pullMethod · 0.45
throwMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…