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

Function testEmptyFile

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

Source from the content-addressed store, hash-verified

263// =============================================================================
264
265async function testEmptyFile() {
266 const filePath = path.join(tmpDir, 'pullsync-empty.txt');
267 fs.writeFileSync(filePath, '');
268
269 const fh = await open(filePath, 'r');
270 try {
271 const data = textSync(fh.pullSync());
272 assert.strictEqual(data, '');
273 } finally {
274 await fh.close();
275 }
276}
277
278// =============================================================================
279// pipeToSync: file-to-file sync pipeline

Calls 5

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

Tested by

no test coverage detected