-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: do not write fixture in test-require-symlink
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.
- Loading branch information
Showing
2 changed files
with
47 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters