diff --git a/benchmark/esm/cjs-parse.js b/benchmark/esm/cjs-parse.js index aae8109c2d4e54..13516a93133290 100644 --- a/benchmark/esm/cjs-parse.js +++ b/benchmark/esm/cjs-parse.js @@ -5,8 +5,7 @@ const common = require('../common.js'); const { strictEqual } = require('assert'); const tmpdir = require('../../test/common/tmpdir'); -const benchmarkDirectory = - path.resolve(tmpdir.path, 'benchmark-esm-parse'); +const benchmarkDirectory = tmpdir.resolve('benchmark-esm-parse'); const bench = common.createBenchmark(main, { n: [1e2], diff --git a/benchmark/esm/esm-legacyMainResolve.js b/benchmark/esm/esm-legacyMainResolve.js index f5751e6840ff9a..c5998d2ab5b54b 100644 --- a/benchmark/esm/esm-legacyMainResolve.js +++ b/benchmark/esm/esm-legacyMainResolve.js @@ -8,8 +8,7 @@ const common = require('../common.js'); const tmpdir = require('../../test/common/tmpdir.js'); const { pathToFileURL } = require('node:url'); -const benchmarkDirectory = - path.resolve(tmpdir.path, 'benchmark-import-meta-resolve'); +const benchmarkDirectory = tmpdir.resolve('benchmark-import-meta-resolve'); const configs = { n: [1e4], diff --git a/benchmark/esm/esm-loader-defaultResolve.js b/benchmark/esm/esm-loader-defaultResolve.js index 85409a122637d5..aba4e5344b37f4 100644 --- a/benchmark/esm/esm-loader-defaultResolve.js +++ b/benchmark/esm/esm-loader-defaultResolve.js @@ -8,8 +8,7 @@ const common = require('../common.js'); const tmpdir = require('../../test/common/tmpdir.js'); const { pathToFileURL } = require('node:url'); -const benchmarkDirectory = - path.resolve(tmpdir.path, 'benchmark-import-meta-resolve'); +const benchmarkDirectory = tmpdir.resolve('benchmark-import-meta-resolve'); const parentURL = pathToFileURL(path.join(benchmarkDirectory, 'entry-point.js')); diff --git a/benchmark/fs/read-stream-throughput.js b/benchmark/fs/read-stream-throughput.js index ecdf09bdf3f169..9d4431d360e7d2 100644 --- a/benchmark/fs/read-stream-throughput.js +++ b/benchmark/fs/read-stream-throughput.js @@ -1,15 +1,13 @@ // Test the throughput of the fs.WriteStream class. 'use strict'; -const path = require('path'); const common = require('../common.js'); const fs = require('fs'); const assert = require('assert'); const tmpdir = require('../../test/common/tmpdir'); tmpdir.refresh(); -const filename = path.resolve(tmpdir.path, - `.removeme-benchmark-garbage-${process.pid}`); +const filename = tmpdir.resolve(`.removeme-benchmark-garbage-${process.pid}`); const bench = common.createBenchmark(main, { encodingType: ['buf', 'asc', 'utf'], diff --git a/benchmark/fs/readfile-permission-enabled.js b/benchmark/fs/readfile-permission-enabled.js index 08ac831cd73d1b..6f762a402dfb5f 100644 --- a/benchmark/fs/readfile-permission-enabled.js +++ b/benchmark/fs/readfile-permission-enabled.js @@ -3,15 +3,13 @@ // Then see how many times it got called. 'use strict'; -const path = require('path'); const common = require('../common.js'); const fs = require('fs'); const assert = require('assert'); const tmpdir = require('../../test/common/tmpdir'); tmpdir.refresh(); -const filename = path.resolve(tmpdir.path, - `.removeme-benchmark-garbage-${process.pid}`); +const filename = tmpdir.resolve(`.removeme-benchmark-garbage-${process.pid}`); const bench = common.createBenchmark(main, { duration: [5], diff --git a/benchmark/fs/readfile-promises.js b/benchmark/fs/readfile-promises.js index 0abe907cdde9ab..b9fcab00333419 100644 --- a/benchmark/fs/readfile-promises.js +++ b/benchmark/fs/readfile-promises.js @@ -3,15 +3,13 @@ // Yes, this is a silly benchmark. Most benchmarks are silly. 'use strict'; -const path = require('path'); const common = require('../common.js'); const fs = require('fs'); const assert = require('assert'); const tmpdir = require('../../test/common/tmpdir'); tmpdir.refresh(); -const filename = path.resolve(tmpdir.path, - `.removeme-benchmark-garbage-${process.pid}`); +const filename = tmpdir.resolve(`.removeme-benchmark-garbage-${process.pid}`); const bench = common.createBenchmark(main, { duration: [5], diff --git a/benchmark/fs/readfile.js b/benchmark/fs/readfile.js index 49958435c797d5..24c2c5401ecf9c 100644 --- a/benchmark/fs/readfile.js +++ b/benchmark/fs/readfile.js @@ -3,15 +3,13 @@ // Yes, this is a silly benchmark. Most benchmarks are silly. 'use strict'; -const path = require('path'); const common = require('../common.js'); const fs = require('fs'); const assert = require('assert'); const tmpdir = require('../../test/common/tmpdir'); tmpdir.refresh(); -const filename = path.resolve(tmpdir.path, - `.removeme-benchmark-garbage-${process.pid}`); +const filename = tmpdir.resolve(`.removeme-benchmark-garbage-${process.pid}`); const bench = common.createBenchmark(main, { duration: [5], diff --git a/benchmark/fs/write-stream-throughput.js b/benchmark/fs/write-stream-throughput.js index bd0220112b1624..288799439725a4 100644 --- a/benchmark/fs/write-stream-throughput.js +++ b/benchmark/fs/write-stream-throughput.js @@ -1,14 +1,12 @@ // Test the throughput of the fs.WriteStream class. 'use strict'; -const path = require('path'); const common = require('../common.js'); const fs = require('fs'); const tmpdir = require('../../test/common/tmpdir'); tmpdir.refresh(); -const filename = path.resolve(tmpdir.path, - `.removeme-benchmark-garbage-${process.pid}`); +const filename = tmpdir.resolve(`.removeme-benchmark-garbage-${process.pid}`); const bench = common.createBenchmark(main, { dur: [5], diff --git a/benchmark/fs/writefile-promises.js b/benchmark/fs/writefile-promises.js index 66b4150374847c..2f3fd352aa886e 100644 --- a/benchmark/fs/writefile-promises.js +++ b/benchmark/fs/writefile-promises.js @@ -3,15 +3,13 @@ // Yes, this is a silly benchmark. Most benchmarks are silly. 'use strict'; -const path = require('path'); const common = require('../common.js'); const fs = require('fs'); const assert = require('assert'); const tmpdir = require('../../test/common/tmpdir'); tmpdir.refresh(); -const filename = path.resolve(tmpdir.path, - `.removeme-benchmark-garbage-${process.pid}`); +const filename = tmpdir.resolve(`.removeme-benchmark-garbage-${process.pid}`); let filesWritten = 0; const bench = common.createBenchmark(main, { duration: [5], diff --git a/benchmark/module/module-loader-circular.js b/benchmark/module/module-loader-circular.js index 0d4f1043ced07d..db382142c2e79b 100644 --- a/benchmark/module/module-loader-circular.js +++ b/benchmark/module/module-loader-circular.js @@ -4,8 +4,7 @@ const path = require('path'); const common = require('../common.js'); const tmpdir = require('../../test/common/tmpdir'); -const benchmarkDirectory = - path.resolve(tmpdir.path, 'benchmark-module-circular'); +const benchmarkDirectory = tmpdir.resolve('benchmark-module-circular'); const bench = common.createBenchmark(main, { n: [1e4], diff --git a/benchmark/module/module-loader-deep.js b/benchmark/module/module-loader-deep.js index b45fa1e716f9ee..338b0686656508 100644 --- a/benchmark/module/module-loader-deep.js +++ b/benchmark/module/module-loader-deep.js @@ -1,10 +1,9 @@ 'use strict'; const fs = require('fs'); -const path = require('path'); const common = require('../common.js'); const tmpdir = require('../../test/common/tmpdir'); -const benchmarkDirectory = path.join(tmpdir.path, 'nodejs-benchmark-module'); +const benchmarkDirectory = tmpdir.resolve('nodejs-benchmark-module'); const bench = common.createBenchmark(main, { ext: ['', '.js'], diff --git a/benchmark/module/module-loader.js b/benchmark/module/module-loader.js index 5ef34f0e7530cf..a885207ff6393a 100644 --- a/benchmark/module/module-loader.js +++ b/benchmark/module/module-loader.js @@ -5,7 +5,7 @@ const { builtinModules } = require('module'); const common = require('../common.js'); const tmpdir = require('../../test/common/tmpdir'); -let benchmarkDirectory = path.join(tmpdir.path, 'nodejs-benchmark-module'); +let benchmarkDirectory = tmpdir.resolve('nodejs-benchmark-module'); // Filter all irregular modules. const otherModules = builtinModules.filter((name) => !/\/|^_|^sys/.test(name)); diff --git a/benchmark/module/module-require.js b/benchmark/module/module-require.js index 2f06365e59b386..5346366dc8e8b7 100644 --- a/benchmark/module/module-require.js +++ b/benchmark/module/module-require.js @@ -1,10 +1,9 @@ 'use strict'; const fs = require('fs'); -const path = require('path'); const common = require('../common.js'); const tmpdir = require('../../test/common/tmpdir'); -const benchmarkDirectory = path.join(tmpdir.path, 'nodejs-benchmark-module'); +const benchmarkDirectory = tmpdir.resolve('nodejs-benchmark-module'); const bench = common.createBenchmark(main, { type: ['.js', '.json', 'dir'], diff --git a/benchmark/process/coverage.js b/benchmark/process/coverage.js index 97c8f057bde62e..01cafe94caa32b 100644 --- a/benchmark/process/coverage.js +++ b/benchmark/process/coverage.js @@ -6,12 +6,11 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { n: [1e5], }); -const path = require('path'); const { rmSync } = require('fs'); const { spawnSync } = require('child_process'); const tmpdir = require('../../test/common/tmpdir'); -const coverageDir = path.join(tmpdir.path, `./cov-${Date.now()}`); +const coverageDir = tmpdir.resolve(`cov-${Date.now()}`); function main({ n }) { bench.start();