We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 597bc14 commit 8048c2eCopy full SHA for 8048c2e
test/parallel/test-internal-fs-syncwritestream.js
@@ -66,6 +66,18 @@ const filename = tmpdir.resolve('sync-write-stream.txt');
66
assert.strictEqual(stream.fd, null);
67
}
68
69
+// Verify that the file is not closed when autoClose=false
70
+{
71
+ const fd = fs.openSync(filename, 'w');
72
+ const stream = new SyncWriteStream(fd, { autoClose: false });
73
+
74
+ stream.on('close', common.mustCall());
75
76
+ assert.strictEqual(stream.destroy(), stream);
77
+ fs.fstatSync(fd); // Does not throw
78
+ fs.closeSync(fd);
79
+}
80
81
// Verify that calling end() will also destroy the stream.
82
{
83
const fd = fs.openSync(filename, 'w');
0 commit comments