summaryrefslogtreecommitdiff
path: root/tests/node_compat/test/parallel/test-fs-write-buffer.js
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2024-06-11 12:41:44 +0100
committerGitHub <noreply@github.com>2024-06-11 11:41:44 +0000
commit6a356aff1380e79d67738c5b43aa2b5fee76600d (patch)
treebe4aadc62a523ff280820958a1a3829f1a18ca7d /tests/node_compat/test/parallel/test-fs-write-buffer.js
parent3d41b486da7dcba49c8a18b45425e356c329d986 (diff)
chore: sync up Node.js test files for v20.11.1 (#24066)
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
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.js17
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);