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

Function testLargeFile

test/parallel/test-fs-promises-file-handle-pullsync.js:46–58  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

44// =============================================================================
45
46async function testLargeFile() {
47 const filePath = path.join(tmpDir, 'pullsync-large.txt');
48 const input = 'sync large data test. '.repeat(10000);
49 fs.writeFileSync(filePath, input);
50
51 const fh = await open(filePath, 'r');
52 try {
53 const data = textSync(fh.pullSync());
54 assert.strictEqual(data, input);
55 } finally {
56 await fh.close();
57 }
58}
59
60// =============================================================================
61// Binary data round-trip

Calls 5

textSyncFunction · 0.85
openFunction · 0.70
closeMethod · 0.65
joinMethod · 0.45
writeFileSyncMethod · 0.45

Tested by

no test coverage detected