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

Function testArrayBufferSyncBasic

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

Source from the content-addressed store, hash-verified

62// =============================================================================
63
64async function testArrayBufferSyncBasic() {
65 const ab = arrayBufferSync(fromSync(new Uint8Array([1, 2, 3])));
66 assert.ok(ab instanceof ArrayBuffer);
67 assert.strictEqual(ab.byteLength, 3);
68 const view = new Uint8Array(ab);
69 assert.deepStrictEqual(view, new Uint8Array([1, 2, 3]));
70}
71
72async function testArrayBufferAsync() {
73 const ab = await arrayBuffer(from(new Uint8Array([10, 20, 30])));

Calls 3

arrayBufferSyncFunction · 0.85
fromSyncFunction · 0.50
okMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…