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>
12 lines
395 B
JavaScript
12 lines
395 B
JavaScript
'use strict';
|
|
const assert = require('assert');
|
|
const path = require('path');
|
|
|
|
const foo = require('./foo');
|
|
|
|
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(__filename.endsWith(linkScriptEnding));
|
|
assert(__filename in require.cache);
|