Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add test for fsPromises.lchmod #20584

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test: fix to run fsPromises.lchmod test on only macOS
  • Loading branch information
Masashi Hirano committed May 25, 2018
commit 9050df0b243d3d3e3340d418b7d12cd0199f5328
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