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

Function testPullAsyncSABChunks

test/parallel/test-stream-iter-sharedarraybuffer.js:142–154  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

140}
141
142async function testPullAsyncSABChunks() {
143 async function* gen() {
144 const sab = new SharedArrayBuffer(2);
145 new Uint8Array(sab).set([3, 4]);
146 yield [new Uint8Array(sab)];
147 }
148 const batches = [];
149 for await (const batch of pull(gen())) {
150 batches.push(batch);
151 }
152 assert.strictEqual(batches.length, 1);
153 assert.deepStrictEqual(batches[0][0], new Uint8Array([3, 4]));
154}
155
156// =============================================================================
157// Transform returning SAB

Calls 3

pullFunction · 0.70
genFunction · 0.70
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…