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

Function testNoAutoClose

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

Source from the content-addressed store, hash-verified

220// =============================================================================
221
222async function testNoAutoClose() {
223 const filePath = path.join(tmpDir, 'pullsync-no-autoclose.txt');
224 fs.writeFileSync(filePath, 'still open');
225
226 const fh = await open(filePath, 'r');
227 const data = textSync(fh.pullSync());
228 assert.strictEqual(data, 'still open');
229
230 // Handle should still be open and reusable
231 const stat = await fh.stat();
232 assert.ok(stat.size > 0);
233 await fh.close();
234}
235
236// =============================================================================
237// Lock semantics - pullSync locks the handle

Calls 7

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

Tested by

no test coverage detected