Skip to content

Commit

Permalink
test: fix to run fsPromises.lchmod test on only macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
Masashi Hirano committed May 25, 2018
1 parent 8a574c3 commit 9050df0
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions test/parallel/test-fs-promises.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,18 +129,21 @@ function verifyStatObject(stat) {

if (common.canCreateSymLink()) {
const newLink = path.resolve(tmpDir, 'baz3.js');
const newMode = 0o666;
await symlink(newPath, newLink);
await lchmod(newLink, newMode);

stats = await lstat(newLink);
verifyStatObject(stats);

assert.strictEqual(newPath.toLowerCase(),
(await realpath(newLink)).toLowerCase());
assert.strictEqual(newPath.toLowerCase(),
(await readlink(newLink)).toLowerCase());
assert.strictEqual(stats.mode & 0o777, newMode);
if (common.isOSX) {
// lchmod is only available on macOS
const newMode = 0o666;
await lchmod(newLink, newMode);
assert.strictEqual(await lstat(newLink).mode & 0o777, newMode);
}


await unlink(newLink);
}
Expand Down

0 comments on commit 9050df0

Please sign in to comment.