Skip to content
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
Next Next commit
test: add test for fsPromises.lchmod
To increase test coverage for fs/promises,
add test for fsPromises.lchmod.
  • Loading branch information
Masashi Hirano committed May 25, 2018
commit 8a574c3f3d17199ae7afd14401078cc3389833e3
4 changes: 4 additions & 0 deletions test/parallel/test-fs-promises.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const {
chmod,
copyFile,
link,
lchmod,
lstat,
mkdir,
mkdtemp,
Expand Down Expand Up @@ -128,7 +129,9 @@ function verifyStatObject(stat) {

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed it. Thank you for your review.


stats = await lstat(newLink);
verifyStatObject(stats);
Expand All @@ -137,6 +140,7 @@ function verifyStatObject(stat) {
(await realpath(newLink)).toLowerCase());
assert.strictEqual(newPath.toLowerCase(),
(await readlink(newLink)).toLowerCase());
assert.strictEqual(stats.mode & 0o777, newMode);

await unlink(newLink);
}
Expand Down