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.

Backport-PR-URL: #22380
PR-URL: #19049
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Khaidi Chu <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
  • Loading branch information
kfarnung authored and MylesBorins committed Sep 6, 2018
1 parent 85aa639 commit 61dd5b7
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 61dd5b7

Please sign in to comment.