mirror of https://github.com/lukechilds/node.git
Browse Source
test-require-symlink modifies the fixture directory by adding a symlink. Copy the fixture to the test tmpdir instead of modifying the fixture directory. This also uses a more empirical test for checking for the ability to make symlinks on Windows. PR-URL: https://github.com/nodejs/node/pull/15067 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>canary-base
Rich Trott
7 years ago
2 changed files with 47 additions and 32 deletions
@ -1,11 +1,12 @@ |
|||
'use strict'; |
|||
const assert = require('assert'); |
|||
const path = require('path'); |
|||
|
|||
const foo = require('./foo'); |
|||
const fixtures = require('../../common/fixtures'); |
|||
|
|||
const linkScriptTarget = fixtures.path('module-require-symlink', 'symlinked.js'); |
|||
const linkScriptEnding = path.join('module-require-symlink', 'symlinked.js'); |
|||
|
|||
assert.strictEqual(foo.dep1.bar.version, 'CORRECT_VERSION'); |
|||
assert.strictEqual(foo.dep2.bar.version, 'CORRECT_VERSION'); |
|||
assert.strictEqual(__filename, linkScriptTarget); |
|||
assert(__filename.endsWith(linkScriptEnding)); |
|||
assert(__filename in require.cache); |
|||
|
Loading…
Reference in new issue