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

Function testSyncRead

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

Source from the content-addressed store, hash-verified

407// =============================================================================
408
409function testSyncRead() {
410 const source = fromSync('immediate');
411 const readable = toReadableSync(source);
412
413 // Synchronous read should return data right away
414 const chunk = readable.read();
415 assert.ok(Buffer.isBuffer(chunk));
416 assert.strictEqual(chunk.toString(), 'immediate');
417}
418
419// =============================================================================
420// fromStreamIterSync: backpressure with small highWaterMark

Callers 1

Calls 5

toReadableSyncFunction · 0.85
fromSyncFunction · 0.50
readMethod · 0.45
okMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected