node/test/fixtures/module-require-symlink/symlinked.js
Rich Trott 6f340762d8 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>
2017-09-19 15:42:16 -07:00

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);