diff --git a/benchmark/esm/cjs-parse.js b/benchmark/esm/cjs-parse.js index aae8109c2d4..13516a93133 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 f5751e6840f..c5998d2ab5b 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 85409a12263..aba4e5344b3 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 ecdf09bdf3f..9d4431d360e 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 08ac831cd73..6f762a402df 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 0abe907cdde..b9fcab00333 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 49958435c79..24c2c5401ec 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 bd0220112b1..28879943972 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 66b41503748..2f3fd352aa8 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 0d4f1043ced..db382142c2e 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 b45fa1e716f..338b0686656 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 5ef34f0e753..a885207ff63 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 2f06365e59b..5346366dc8e 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 97c8f057bde..01cafe94caa 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();