diff --git a/test/parallel/test-fs-write.js b/test/parallel/test-fs-write.js index fd0e6b768da042..cd6dc9843222ad 100644 --- a/test/parallel/test-fs-write.js +++ b/test/parallel/test-fs-write.js @@ -70,3 +70,14 @@ fs.open(fn2, constants.O_CREAT | constants.O_WRONLY | constants.O_TRUNC, 0o644, assert.strictEqual(expected, found); })); })); + + +fs.open(fn, 'w', 0o644, common.mustCall(function(err, fd) { + assert.ifError(err); + const done = common.mustCall(function(err, written) { + assert.ifError(err); + assert.strictEqual(Buffer.byteLength(expected), written); + fs.closeSync(fd); + }); + fs.write(fd, expected, done); +}));