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

Function testArraySyncBasic

test/parallel/test-stream-iter-consumers-bytes.js:84–95  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

82// =============================================================================
83
84async function testArraySyncBasic() {
85 function* gen() {
86 yield new Uint8Array([1]);
87 yield new Uint8Array([2]);
88 yield new Uint8Array([3]);
89 }
90 const chunks = arraySync(fromSync(gen()));
91 assert.strictEqual(chunks.length, 3);
92 assert.deepStrictEqual(chunks[0], new Uint8Array([1]));
93 assert.deepStrictEqual(chunks[1], new Uint8Array([2]));
94 assert.deepStrictEqual(chunks[2], new Uint8Array([3]));
95}
96
97async function testArraySyncLimit() {
98 function* gen() {

Calls 3

arraySyncFunction · 0.85
genFunction · 0.70
fromSyncFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…