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
Prev Previous commit
fixup! lib: mask mode_t type of arguments with 0o777
  • Loading branch information
joyeecheung committed May 17, 2018
commit 37af759be77bb70a6c8e8c861318c2c0a182fbfb
26 changes: 4 additions & 22 deletions test/parallel/test-fs-promises.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,28 +113,10 @@ function verifyStatObject(stat) {
await fchmod(handle, 0o666);
await handle.chmod(0o666);

// `mode` can't be > 0o777
assert.rejects(
async () => chmod(handle, (0o777 + 1)),
{
code: 'ERR_INVALID_ARG_TYPE',
name: 'TypeError [ERR_INVALID_ARG_TYPE]'
}
);
assert.rejects(
async () => fchmod(handle, (0o777 + 1)),
{
code: 'ERR_OUT_OF_RANGE',
name: 'RangeError [ERR_OUT_OF_RANGE]'
}
);
assert.rejects(
async () => handle.chmod(handle, (0o777 + 1)),
{
code: 'ERR_INVALID_ARG_TYPE',
name: 'TypeError [ERR_INVALID_ARG_TYPE]'
}
);
// Mode larger than 0o777 should be masked off.
await chmod(dest, (0o777 + 1));
await fchmod(handle, 0o777 + 1);
await handle.chmod(0o777 + 1);

await utimes(dest, new Date(), new Date());

Expand Down