Skip to content

Commit a3af644

Browse files
avivkellertargos
authored andcommitted
test: allow tmpDir.path to be modified
PR-URL: #58173 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 3b8d4e3 commit a3af644

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

test/common/tmpdir.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const testRoot = process.env.NODE_TEST_DIR ?
3939
// gets tools to ignore it by default or by simple rules, especially eslint.
4040
const tmpdirName = '.tmp.' +
4141
(process.env.TEST_SERIAL_ID || process.env.TEST_THREAD_ID || '0');
42-
const tmpPath = path.join(testRoot, tmpdirName);
42+
let tmpPath = path.join(testRoot, tmpdirName);
4343

4444
let firstRefresh = true;
4545
function refresh(useSpawn = false) {
@@ -100,7 +100,13 @@ function fileURL(...paths) {
100100
module.exports = {
101101
fileURL,
102102
hasEnoughSpace,
103-
path: tmpPath,
104103
refresh,
105104
resolve,
105+
106+
get path() {
107+
return tmpPath;
108+
},
109+
set path(newPath) {
110+
tmpPath = path.resolve(newPath);
111+
},
106112
};

0 commit comments

Comments
 (0)