Skip to content
This repository was archived by the owner on Oct 15, 2020. It is now read-only.

Commit 8d6c6f5

Browse files
committed
fs: skip symlink testing on Windows
A non-admin user on Windows can't create symlinks, so catch that case and don't fail the test.
1 parent 7de203d commit 8d6c6f5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/parallel/test-fs-promises.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,13 @@ function verifyStatObject(stat) {
117117
verifyStatObject(stats);
118118

119119
const newLink = path.resolve(tmpDir, 'baz3.js');
120-
await symlink(newPath, newLink);
120+
try {
121+
await symlink(newPath, newLink);
122+
} catch (err) {
123+
if (err.code !== 'EPERM') throw err;
124+
// insufficient privileges for symlinks, skip the rest
125+
return;
126+
}
121127

122128
const newLink2 = path.resolve(tmpDir, 'baz4.js');
123129
await link(newPath, newLink2);

0 commit comments

Comments
 (0)