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

Function testByteModeBytes

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

Source from the content-addressed store, hash-verified

66// =============================================================================
67
68async function testByteModeBytes() {
69 const data = Buffer.from('binary data here');
70 const readable = new Readable({
71 read() {
72 this.push(data);
73 this.push(null);
74 },
75 });
76
77 const result = await bytes(from(readable));
78 assert.deepStrictEqual(result, new Uint8Array(data));
79}
80
81// =============================================================================
82// Byte-mode Readable: batching - multiple buffered chunks yield as one batch

Calls 3

bytesFunction · 0.50
fromFunction · 0.50
fromMethod · 0.45

Tested by

no test coverage detected