From 28e0762b1c5dbcb8f36894c5f72123f5860bce9b Mon Sep 17 00:00:00 2001 From: Gibson Fahnestock Date: Tue, 10 Jan 2017 13:43:08 +0000 Subject: [PATCH] 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: https://github.com/nodejs/node/pull/10723 Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Sakthipriyan Vairamani Reviewed-By: Michael Dawson --- test/common.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/common.js b/test/common.js index 17d83117908501..3813b07998cb6c 100644 --- a/test/common.js +++ b/test/common.js @@ -9,7 +9,7 @@ const stream = require('stream'); const util = require('util'); const testRoot = process.env.NODE_TEST_DIR ? - path.resolve(process.env.NODE_TEST_DIR) : __dirname; + fs.realpathSync(process.env.NODE_TEST_DIR) : __dirname; exports.testDir = __dirname; exports.fixturesDir = path.join(exports.testDir, 'fixtures');