MCPcopy Create free account
hub / github.com/nodejs/node / validateRead

Function validateRead

test/parallel/test-fs-promises-file-handle-stream.js:32–43  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

30}
31
32async function validateRead() {
33 const filePathForHandle = path.resolve(tmpDir, 'tmp-read.txt');
34 const buf = Buffer.from('Hello world'.repeat(100), 'utf8');
35
36 fs.writeFileSync(filePathForHandle, buf);
37
38 const fileHandle = await open(filePathForHandle);
39 assert.deepStrictEqual(
40 await buffer(fileHandle.createReadStream()),
41 buf
42 );
43}
44
45Promise.all([
46 validateWrite(),

Calls 6

openFunction · 0.70
bufferFunction · 0.70
resolveMethod · 0.45
fromMethod · 0.45
writeFileSyncMethod · 0.45
createReadStreamMethod · 0.45

Tested by

no test coverage detected