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 <[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 committed Mar 6, 2018
1 parent 9f0618c commit 4639b54
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 4639b54

Please sign in to comment.