MCPcopy Create free account
hub / github.com/nodejs/node / testEmptyBatchAsync

Function testEmptyBatchAsync

test/parallel/test-stream-iter-to-readable.js:126–136  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

124// =============================================================================
125
126async function testEmptyBatchAsync() {
127 async function* gen() {
128 yield [];
129 yield [Buffer.from('real data')];
130 yield [];
131 }
132
133 const readable = toReadable(gen());
134 const result = await collect(readable);
135 assert.strictEqual(result.toString(), 'real data');
136}
137
138// =============================================================================
139// fromStreamIter: destroy mid-stream cleans up iterator

Callers 1

Calls 4

toReadableFunction · 0.85
genFunction · 0.70
collectFunction · 0.70
toStringMethod · 0.45

Tested by

no test coverage detected