GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: use `tmpdir.resolve()` in fs tests · nodejs/node@b3c56d2

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/parallel
    • test-fs-promises-file-handle-aggregate-errors.js
    • test-fs-promises-file-handle-close-errors.js
    • test-fs-promises-file-handle-op-errors.js
    • test-fs-promises-file-handle-read-worker.js
    • test-fs-promises-file-handle-readLines.mjs
    • test-fs-promises-file-handle-stat.js
    • test-fs-promises-file-handle-sync.js
    • test-fs-promises-file-handle-truncate.js
    • test-fs-promises-readfile-with-fd.js
    • test-fs-promises-readfile.js
    • test-fs-promises-watch.js
    • test-fs-promises-write-optional-params.js
    • test-fs-promises-writefile-with-fd.js
    • test-fs-read-stream-autoClose.js
    • test-fs-read-stream-fd.js
    • test-fs-read-stream-file-handle.js
    • test-fs-read-stream-pos.js
    • test-fs-readfile-fd.js
    • test-fs-readfile-flags.js
    • test-fs-readfile-pipe-large.js
    • test-fs-readfile-unlink.js
    • test-fs-readfile.js
    • test-fs-readfilesync-pipe-large.js
    • test-fs-readv-promises.js
    • test-fs-readv-sync.js
    • test-fs-readv.js
    • test-fs-ready-event-stream.js
    • test-fs-sir-writes-alot.js
    • test-fs-syncwritestream.js
    • test-fs-write-buffer-large.js
    • test-fs-write-buffer.js
    • test-fs-write-file-buffer.js
    • test-fs-write-file-invalid-path.js
    • test-fs-write-file-sync.js
    • test-fs-write-file-typedarrays.js
    • test-fs-write-file.js
    • test-fs-write-negativeoffset.js
    • test-fs-write-optional-params.js
    • test-fs-write-reuse-callback.js
    • test-fs-write-sigxfsz.js
    • test-fs-write-stream-autoclose-option.js
    • test-fs-write-stream-change-open.js
    • test-fs-write-stream-close-without-callback.js
    • test-fs-write-stream-double-close.js
    • test-fs-write-stream-encoding.js
    • test-fs-write-stream-end.js
    • test-fs-write-stream-file-handle-2.js
    • test-fs-write-stream-file-handle.js
    • test-fs-write-stream-fs.js
    • test-fs-write-stream-throw-type-error.js
    • test-fs-write-stream.js
    • test-fs-write-sync-optional-params.js
    • test-fs-write-sync.js
    • test-fs-write.js
    • test-fs-writefile-with-fd.js
    • test-fs-writev-promises.js
    • test-fs-writev-sync.js
    • test-fs-writev.js

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/parallel/test-fs-promises-file-handle-aggregate-errors.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-fs-promises-file-handle-aggregate-errors.js
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ const tmpdir = require('../common/tmpdir');
77
// The following tests validate aggregate errors are thrown correctly
88
// when both an operation and close throw.
99

10-
const path = require('path');
1110
const {
1211
readFile,
1312
writeFile,
@@ -23,7 +22,7 @@ const originalFd = Object.getOwnPropertyDescriptor(FileHandle.prototype, 'fd');
2322

2423
let count = 0;
2524
async function createFile() {
26-
const filePath = path.join(tmpdir.path, `aggregate_errors_${++count}.txt`);
25+
const filePath = tmpdir.resolve(`aggregate_errors_${++count}.txt`);
2726
await writeFile(filePath, 'content');
2827
return filePath;
2928
}
Collapse file

‎test/parallel/test-fs-promises-file-handle-close-errors.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-fs-promises-file-handle-close-errors.js
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ const tmpdir = require('../common/tmpdir');
77
// The following tests validate aggregate errors are thrown correctly
88
// when both an operation and close throw.
99

10-
const path = require('path');
1110
const {
1211
readFile,
1312
writeFile,
@@ -23,7 +22,7 @@ const originalFd = Object.getOwnPropertyDescriptor(FileHandle.prototype, 'fd');
2322

2423
let count = 0;
2524
async function createFile() {
26-
const filePath = path.join(tmpdir.path, `close_errors_${++count}.txt`);
25+
const filePath = tmpdir.resolve(`close_errors_${++count}.txt`);
2726
await writeFile(filePath, 'content');
2827
return filePath;
2928
}
Collapse file

‎test/parallel/test-fs-promises-file-handle-op-errors.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-fs-promises-file-handle-op-errors.js
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ const tmpdir = require('../common/tmpdir');
77
// The following tests validate aggregate errors are thrown correctly
88
// when both an operation and close throw.
99

10-
const path = require('path');
1110
const {
1211
readFile,
1312
writeFile,
@@ -23,7 +22,7 @@ const originalFd = Object.getOwnPropertyDescriptor(FileHandle.prototype, 'fd');
2322

2423
let count = 0;
2524
async function createFile() {
26-
const filePath = path.join(tmpdir.path, `op_errors_${++count}.txt`);
25+
const filePath = tmpdir.resolve(`op_errors_${++count}.txt`);
2726
await writeFile(filePath, 'content');
2827
return filePath;
2928
}
Collapse file

‎test/parallel/test-fs-promises-file-handle-read-worker.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-fs-promises-file-handle-read-worker.js
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
const common = require('../common');
33
const fs = require('fs');
44
const assert = require('assert');
5-
const path = require('path');
65
const tmpdir = require('../common/tmpdir');
7-
const file = path.join(tmpdir.path, 'read_stream_filehandle_worker.txt');
6+
const file = tmpdir.resolve('read_stream_filehandle_worker.txt');
87
const input = 'hello world';
98
const { Worker, isMainThread, workerData } = require('worker_threads');
109

Collapse file

‎test/parallel/test-fs-promises-file-handle-readLines.mjs‎

Copy file name to clipboardExpand all lines: test/parallel/test-fs-promises-file-handle-readLines.mjs
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@ import tmpdir from '../common/tmpdir.js';
33

44
import assert from 'node:assert';
55
import { open, writeFile } from 'node:fs/promises';
6-
import path from 'node:path';
76

87
tmpdir.refresh();
98

10-
const filePath = path.join(tmpdir.path, 'file.txt');
9+
const filePath = tmpdir.resolve('file.txt');
1110

1211
await writeFile(filePath, '1\n\n2\n');
1312

Collapse file

‎test/parallel/test-fs-promises-file-handle-stat.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-fs-promises-file-handle-stat.js
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@ const common = require('../common');
66
// FileHandle.stat method.
77

88
const { open } = require('fs').promises;
9-
const path = require('path');
109
const tmpdir = require('../common/tmpdir');
1110
const assert = require('assert');
1211

1312
tmpdir.refresh();
1413

1514
async function validateStat() {
16-
const filePath = path.resolve(tmpdir.path, 'tmp-read-file.txt');
15+
const filePath = tmpdir.resolve('tmp-read-file.txt');
1716
const fileHandle = await open(filePath, 'w+');
1817
const stats = await fileHandle.stat();
1918
assert.ok(stats.mtime instanceof Date);
Collapse file

‎test/parallel/test-fs-promises-file-handle-sync.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-fs-promises-file-handle-sync.js
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ const fixtures = require('../common/fixtures');
55
const tmpdir = require('../common/tmpdir');
66

77
const { access, copyFile, open } = require('fs').promises;
8-
const path = require('path');
98

109
async function validate() {
1110
tmpdir.refresh();
12-
const dest = path.resolve(tmpdir.path, 'baz.js');
11+
const dest = tmpdir.resolve('baz.js');
1312
await assert.rejects(
1413
copyFile(fixtures.path('baz.js'), dest, 'r'),
1514
{
Collapse file

‎test/parallel/test-fs-promises-file-handle-truncate.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-fs-promises-file-handle-truncate.js
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22

33
const common = require('../common');
44
const assert = require('assert');
5-
const path = require('path');
65
const { open, readFile } = require('fs').promises;
76
const tmpdir = require('../common/tmpdir');
87

98
tmpdir.refresh();
109

1110
async function validateTruncate() {
1211
const text = 'Hello world';
13-
const filename = path.resolve(tmpdir.path, 'truncate-file.txt');
12+
const filename = tmpdir.resolve('truncate-file.txt');
1413
const fileHandle = await open(filename, 'w+');
1514

1615
const buffer = Buffer.from(text, 'utf8');
Collapse file

‎test/parallel/test-fs-promises-readfile-with-fd.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-fs-promises-readfile-with-fd.js
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@
55

66
const common = require('../common');
77
const assert = require('assert');
8-
const path = require('path');
98
const { writeFileSync } = require('fs');
109
const { open } = require('fs').promises;
1110

1211
const tmpdir = require('../common/tmpdir');
1312
tmpdir.refresh();
1413

15-
const fn = path.join(tmpdir.path, 'test.txt');
14+
const fn = tmpdir.resolve('test.txt');
1615
writeFileSync(fn, 'Hello World');
1716

1817
async function readFileTest() {
Collapse file

‎test/parallel/test-fs-promises-readfile.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-fs-promises-readfile.js
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@
44
const common = require('../common');
55

66
const assert = require('assert');
7-
const path = require('path');
87
const { writeFile, readFile } = require('fs').promises;
98
const tmpdir = require('../common/tmpdir');
109
const { internalBinding } = require('internal/test/binding');
1110
const fsBinding = internalBinding('fs');
1211
tmpdir.refresh();
1312

14-
const fn = path.join(tmpdir.path, 'large-file');
13+
const fn = tmpdir.resolve('large-file');
1514

1615
// Creating large buffer with random content
1716
const largeBuffer = Buffer.from(

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.