Skip to content

Commit

Permalink
test: specify 'dir' for directory symlinks
Browse files Browse the repository at this point in the history
Directory symlinks in Windows require the 'dir' flag to be passed to
create the symlink correctly.

PR-URL: nodejs/node#19049
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
  • Loading branch information
kfarnung committed Mar 6, 2018
1 parent 98a9036 commit 7993348
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion test/addons/symlinked-module/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const addonPath = path.join(__dirname, 'build', common.buildType);
const addonLink = path.join(common.tmpDir, 'addon');

try {
fs.symlinkSync(addonPath, addonLink);
fs.symlinkSync(addonPath, addonLink, 'dir');
} catch (err) {
if (err.code !== 'EPERM') throw err;
common.skip('module identity test (no privs for symlinks)');
Expand Down
2 changes: 1 addition & 1 deletion test/es-module/test-esm-symlink.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ try {
fs.symlinkSync(real, link_absolute_path);
fs.symlinkSync(path.basename(real), link_relative_path);
fs.symlinkSync(real, link_ignore_extension);
fs.symlinkSync(path.dirname(real), link_directory);
fs.symlinkSync(path.dirname(real), link_directory, 'dir');
} catch (err) {
if (err.code !== 'EPERM') throw err;
common.skip('insufficient privileges for symlinks');
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-module-symlinked-peer-modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ fs.mkdirSync(moduleB);
// Attempt to make the symlink. If this fails due to lack of sufficient
// permissions, the test will bail out and be skipped.
try {
fs.symlinkSync(moduleA, moduleA_link);
fs.symlinkSync(moduleA, moduleA_link, 'dir');
} catch (err) {
if (err.code !== 'EPERM') throw err;
common.skip('insufficient privileges for symlinks');
Expand Down

0 comments on commit 7993348

Please sign in to comment.