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

Function testBasicPullSync

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

Source from the content-addressed store, hash-verified

27// =============================================================================
28
29async function testBasicPullSync() {
30 const filePath = path.join(tmpDir, 'pullsync-basic.txt');
31 fs.writeFileSync(filePath, 'hello from sync file read');
32
33 const fh = await open(filePath, 'r');
34 try {
35 const data = textSync(fh.pullSync());
36 assert.strictEqual(data, 'hello from sync file read');
37 } finally {
38 await fh.close();
39 }
40}
41
42// =============================================================================
43// Large file (multi-chunk)

Calls 5

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

Tested by

no test coverage detected