Skip to content

Commit 76cd2b9

Browse files
gibfahnItalo A. Casas
authored andcommitted
test: use realpath for NODE_TEST_DIR in common.js
If you don't specify NODE_TEST_DIR, common.tmpDir will resolve to the realpath of `node/test`. If you do specify NODE_TEST_DIR (with the environment variable or by running or by running tools/test.py --test-dir=x), common.tmpDir (which is resolved from testRoot) uses the symbolic path (doesn't resolve symlinks). This uses fs.realpathSync() to fix that. PR-URL: nodejs#10723 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
1 parent f7f2bfc commit 76cd2b9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

test/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ Synchronous version of `spawnPwd`.
373373
### tmpDir
374374
* return [&lt;String>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type)
375375

376-
Path to the 'tmp' directory.
376+
The realpath of the 'tmp' directory.
377377

378378
### tmpDirName
379379
* return [&lt;String>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type)

test/common.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const Timer = process.binding('timer_wrap').Timer;
1111
const execSync = require('child_process').execSync;
1212

1313
const testRoot = process.env.NODE_TEST_DIR ?
14-
path.resolve(process.env.NODE_TEST_DIR) : __dirname;
14+
fs.realpathSync(process.env.NODE_TEST_DIR) : __dirname;
1515

1616
exports.fixturesDir = path.join(__dirname, 'fixtures');
1717
exports.tmpDirName = 'tmp';

0 commit comments

Comments
 (0)