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

Function testByteModeThroughFrom

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

Source from the content-addressed store, hash-verified

32// =============================================================================
33
34async function testByteModeThroughFrom() {
35 const readable = new Readable({
36 read() {
37 this.push(Buffer.from('hello'));
38 this.push(Buffer.from(' world'));
39 this.push(null);
40 },
41 });
42
43 const result = await text(from(readable));
44 assert.strictEqual(result, 'hello world');
45}
46
47// =============================================================================
48// Byte-mode Readable: basic round-trip through pull()

Calls 2

textFunction · 0.50
fromFunction · 0.50

Tested by

no test coverage detected