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

Function testClosedHandle

test/parallel/test-fs-promises-file-handle-writer.js:266–275  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

264// =============================================================================
265
266async function testClosedHandle() {
267 const filePath = path.join(tmpDir, 'writer-closed-handle.txt');
268 const fh = await open(filePath, 'w');
269 await fh.close();
270
271 assert.throws(() => fh.writer(), {
272 name: 'Error',
273 message: /closed/,
274 });
275}
276
277// =============================================================================
278// pipeTo() integration - pipe source through writer

Calls 4

writerMethod · 0.80
openFunction · 0.70
closeMethod · 0.65
joinMethod · 0.45

Tested by

no test coverage detected