From 61dd5b73b50e4a84f1cdea52009020d8ee716edd Mon Sep 17 00:00:00 2001 From: Kyle Farnung Date: Tue, 27 Feb 2018 14:24:21 -0800 Subject: [PATCH] test: specify 'dir' for directory symlinks Directory symlinks in Windows require the 'dir' flag to be passed to create the symlink correctly. Backport-PR-URL: https://github.com/nodejs/node/pull/22380 PR-URL: https://github.com/nodejs/node/pull/19049 Reviewed-By: Richard Lau Reviewed-By: Khaidi Chu Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: Daniel Bevenius Reviewed-By: James M Snell Reviewed-By: Ruben Bridgewater --- test/addons/symlinked-module/test.js | 2 +- test/es-module/test-esm-symlink.js | 2 +- test/parallel/test-module-symlinked-peer-modules.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/addons/symlinked-module/test.js b/test/addons/symlinked-module/test.js index 53306399cb520b..e8c26544f2a38c 100644 --- a/test/addons/symlinked-module/test.js +++ b/test/addons/symlinked-module/test.js @@ -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)'); diff --git a/test/es-module/test-esm-symlink.js b/test/es-module/test-esm-symlink.js index 074230ac06c4b5..232925a52e3f64 100644 --- a/test/es-module/test-esm-symlink.js +++ b/test/es-module/test-esm-symlink.js @@ -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'); diff --git a/test/parallel/test-module-symlinked-peer-modules.js b/test/parallel/test-module-symlinked-peer-modules.js index f93dea720f9a12..27e67b31d182e5 100644 --- a/test/parallel/test-module-symlinked-peer-modules.js +++ b/test/parallel/test-module-symlinked-peer-modules.js @@ -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');