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

Function testByteModeThroughPull

test/parallel/test-stream-iter-readable-interop.js:51–62  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

49// =============================================================================
50
51async function testByteModeThroughPull() {
52 const readable = new Readable({
53 read() {
54 this.push(Buffer.from('pull '));
55 this.push(Buffer.from('test'));
56 this.push(null);
57 },
58 });
59
60 const result = await text(pull(readable));
61 assert.strictEqual(result, 'pull test');
62}
63
64// =============================================================================
65// Byte-mode Readable: bytes consumer

Calls 2

pullFunction · 0.70
textFunction · 0.50

Tested by

no test coverage detected