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: #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 authored and addaleax committed Mar 5, 2018
1 parent eca333a commit fd27165
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 @@ -19,7 +19,7 @@ const addonPath = path.join(__dirname, 'build', common.buildType);
const addonLink = path.join(tmpdir.path, '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 @@ -37,7 +37,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 @@ -43,7 +43,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 fd27165

Please sign in to comment.