summaryrefslogtreecommitdiff
path: root/test/parallel/test-fs-promises.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/parallel/test-fs-promises.js')
-rw-r--r--test/parallel/test-fs-promises.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/parallel/test-fs-promises.js b/test/parallel/test-fs-promises.js
index 4c3d7346ff..3c7903c98f 100644
--- a/test/parallel/test-fs-promises.js
+++ b/test/parallel/test-fs-promises.js
@@ -83,6 +83,7 @@ async function getHandle(dest) {
{
const handle = await getHandle(dest);
assert.strictEqual(typeof handle, 'object');
+ await handle.close();
}
// file stats
@@ -106,6 +107,7 @@ async function getHandle(dest) {
await handle.datasync();
await handle.sync();
+ await handle.close();
}
// Test fs.read promises when length to read is zero bytes
@@ -119,6 +121,7 @@ async function getHandle(dest) {
assert.strictEqual(ret.bytesRead, 0);
await unlink(dest);
+ await handle.close();
}
// Bytes written to file match buffer
@@ -130,6 +133,7 @@ async function getHandle(dest) {
const ret = await handle.read(Buffer.alloc(bufLen), 0, bufLen, 0);
assert.strictEqual(ret.bytesRead, bufLen);
assert.deepStrictEqual(ret.buffer, buf);
+ await handle.close();
}
// Truncate file to specified length
@@ -143,6 +147,7 @@ async function getHandle(dest) {
assert.deepStrictEqual(ret.buffer, buf);
await truncate(dest, 5);
assert.deepStrictEqual((await readFile(dest)).toString(), 'hello');
+ await handle.close();
}
// Invalid change of ownership
@@ -181,6 +186,8 @@ async function getHandle(dest) {
message: 'The value of "gid" is out of range. ' +
'It must be >= 0 && < 4294967296. Received -1'
});
+
+ await handle.close();
}
// Set modification times