diff options
Diffstat (limited to 'test/parallel/test-require-symlink.js')
-rw-r--r-- | test/parallel/test-require-symlink.js | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/test/parallel/test-require-symlink.js b/test/parallel/test-require-symlink.js index 222494aaf1..8f15845947 100644 --- a/test/parallel/test-require-symlink.js +++ b/test/parallel/test-require-symlink.js @@ -6,19 +6,22 @@ const path = require('path'); const fs = require('fs'); const { exec, spawn } = require('child_process'); const util = require('util'); +const fixtures = require('../common/fixtures'); common.refreshTmpDir(); -const linkTarget = path.join(common.fixturesDir, - '/module-require-symlink/node_modules/dep2/'); +const linkTarget = fixtures.path('module-require-symlink', + 'node_modules', + 'dep2'); -const linkDir = path.join( - common.fixturesDir, - '/module-require-symlink/node_modules/dep1/node_modules/dep2' -); +const linkDir = fixtures.path('module-require-symlink', + 'node_modules', + 'dep1', + 'node_modules', + 'dep2'); -const linkScriptTarget = path.join(common.fixturesDir, - '/module-require-symlink/symlinked.js'); +const linkScriptTarget = fixtures.path('module-require-symlink', + 'symlinked.js'); const linkScript = path.join(common.tmpDir, 'module-require-symlink.js'); @@ -44,8 +47,7 @@ function test() { fs.symlinkSync(linkScriptTarget, linkScript); // load symlinked-module - const fooModule = - require(path.join(common.fixturesDir, '/module-require-symlink/foo.js')); + const fooModule = require(fixtures.path('/module-require-symlink/foo.js')); assert.strictEqual(fooModule.dep1.bar.version, 'CORRECT_VERSION'); assert.strictEqual(fooModule.dep2.bar.version, 'CORRECT_VERSION'); |