diff options
author | Rich Trott <rtrott@gmail.com> | 2017-12-24 22:38:11 -0800 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2018-01-31 22:11:07 -0800 |
commit | bf6ce47259ebfe9f6349c223cc1735726aee062d (patch) | |
tree | 2f40f8e9618a253862cf1f0953992c8c16b56772 /test/parallel/test-require-symlink.js | |
parent | 6035beea93e16f6d923201a33a541f6d724f00d6 (diff) | |
download | android-node-v8-bf6ce47259ebfe9f6349c223cc1735726aee062d.tar.gz android-node-v8-bf6ce47259ebfe9f6349c223cc1735726aee062d.tar.bz2 android-node-v8-bf6ce47259ebfe9f6349c223cc1735726aee062d.zip |
test: move tmpdir to submodule of common
Move tmpdir functionality to its own module (common/tmpdir).
PR-URL: https://github.com/nodejs/node/pull/17856
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Diffstat (limited to 'test/parallel/test-require-symlink.js')
-rw-r--r-- | test/parallel/test-require-symlink.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/test/parallel/test-require-symlink.js b/test/parallel/test-require-symlink.js index 60962156f2..d245c21dd1 100644 --- a/test/parallel/test-require-symlink.js +++ b/test/parallel/test-require-symlink.js @@ -14,12 +14,13 @@ const process = require('process'); // Setup: Copy fixtures to tmp directory. const fixtures = require('../common/fixtures'); +const tmpdir = require('../common/tmpdir'); const dirName = 'module-require-symlink'; const fixtureSource = fixtures.path(dirName); -const tmpDirTarget = path.join(common.tmpDir, dirName); +const tmpDirTarget = path.join(tmpdir.path, dirName); // Copy fixtureSource to linkTarget recursively. -common.refreshTmpDir(); +tmpdir.refresh(); function copyDir(source, target) { fs.mkdirSync(target); @@ -40,7 +41,7 @@ copyDir(fixtureSource, tmpDirTarget); // Move to tmp dir and do everything with relative paths there so that the test // doesn't incorrectly fail due to a symlink somewhere else in the absolute // path. -process.chdir(common.tmpDir); +process.chdir(tmpdir.path); const linkDir = path.join(dirName, 'node_modules', |