diff options
Diffstat (limited to 'tests/node_compat/test/parallel/test-fs-write-buffer.js')
-rw-r--r-- | tests/node_compat/test/parallel/test-fs-write-buffer.js | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/tests/node_compat/test/parallel/test-fs-write-buffer.js b/tests/node_compat/test/parallel/test-fs-write-buffer.js index c867d3cd1..13ee5f068 100644 --- a/tests/node_compat/test/parallel/test-fs-write-buffer.js +++ b/tests/node_compat/test/parallel/test-fs-write-buffer.js @@ -29,7 +29,6 @@ 'use strict'; const common = require('../common'); const assert = require('assert'); -const path = require('path'); const fs = require('fs'); const expected = Buffer.from('hello'); @@ -38,7 +37,7 @@ tmpdir.refresh(); // fs.write with all parameters provided: { - const filename = path.join(tmpdir.path, 'write1.txt'); + const filename = tmpdir.resolve('write1.txt'); fs.open(filename, 'w', 0o644, common.mustSucceed((fd) => { const cb = common.mustSucceed((written) => { assert.strictEqual(written, expected.length); @@ -54,7 +53,7 @@ tmpdir.refresh(); // fs.write with a buffer, without the length parameter: { - const filename = path.join(tmpdir.path, 'write2.txt'); + const filename = tmpdir.resolve('write2.txt'); fs.open(filename, 'w', 0o644, common.mustSucceed((fd) => { const cb = common.mustSucceed((written) => { assert.strictEqual(written, 2); @@ -70,7 +69,7 @@ tmpdir.refresh(); // fs.write with a buffer, without the offset and length parameters: { - const filename = path.join(tmpdir.path, 'write3.txt'); + const filename = tmpdir.resolve('write3.txt'); fs.open(filename, 'w', 0o644, common.mustSucceed((fd) => { const cb = common.mustSucceed((written) => { assert.strictEqual(written, expected.length); @@ -86,7 +85,7 @@ tmpdir.refresh(); // fs.write with the offset passed as undefined followed by the callback: { - const filename = path.join(tmpdir.path, 'write4.txt'); + const filename = tmpdir.resolve('write4.txt'); fs.open(filename, 'w', 0o644, common.mustSucceed((fd) => { const cb = common.mustSucceed((written) => { assert.strictEqual(written, expected.length); @@ -102,7 +101,7 @@ tmpdir.refresh(); // fs.write with offset and length passed as undefined followed by the callback: { - const filename = path.join(tmpdir.path, 'write5.txt'); + const filename = tmpdir.resolve('write5.txt'); fs.open(filename, 'w', 0o644, common.mustSucceed((fd) => { const cb = common.mustSucceed((written) => { assert.strictEqual(written, expected.length); @@ -118,7 +117,7 @@ tmpdir.refresh(); // fs.write with a Uint8Array, without the offset and length parameters: { - const filename = path.join(tmpdir.path, 'write6.txt'); + const filename = tmpdir.resolve('write6.txt'); fs.open(filename, 'w', 0o644, common.mustSucceed((fd) => { const cb = common.mustSucceed((written) => { assert.strictEqual(written, expected.length); @@ -134,7 +133,7 @@ tmpdir.refresh(); // fs.write with invalid offset type { - const filename = path.join(tmpdir.path, 'write7.txt'); + const filename = tmpdir.resolve('write7.txt'); fs.open(filename, 'w', 0o644, common.mustSucceed((fd) => { assert.throws(() => { fs.write(fd, @@ -156,7 +155,7 @@ tmpdir.refresh(); // fs.write with a DataView, without the offset and length parameters: { - const filename = path.join(tmpdir.path, 'write8.txt'); + const filename = tmpdir.resolve('write8.txt'); fs.open(filename, 'w', 0o644, common.mustSucceed((fd) => { const cb = common.mustSucceed((written) => { assert.strictEqual(written, expected.length); |