diff options
author | Rich Trott <rtrott@gmail.com> | 2017-08-27 10:50:00 -0700 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2017-09-19 15:42:16 -0700 |
commit | 6f340762d8296902de079208bd55bf7118814db7 (patch) | |
tree | a258c75425dcf84851d962d826f3dd32180e6b85 /test/fixtures/module-require-symlink | |
parent | 8a968e4ee7b298496c0e781deccbd95e3717d386 (diff) | |
download | android-node-v8-6f340762d8296902de079208bd55bf7118814db7.tar.gz android-node-v8-6f340762d8296902de079208bd55bf7118814db7.tar.bz2 android-node-v8-6f340762d8296902de079208bd55bf7118814db7.zip |
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.
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>
Diffstat (limited to 'test/fixtures/module-require-symlink')
-rw-r--r-- | test/fixtures/module-require-symlink/symlinked.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/test/fixtures/module-require-symlink/symlinked.js b/test/fixtures/module-require-symlink/symlinked.js index ced901b246..8ec2f7b0aa 100644 --- a/test/fixtures/module-require-symlink/symlinked.js +++ b/test/fixtures/module-require-symlink/symlinked.js @@ -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); |