Skip to content

Commit

Permalink
test: add test cases for fsPromises
Browse files Browse the repository at this point in the history
Add tests of lchmod, chown, fchown and lchown.

PR-URL: #19064
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
  • Loading branch information
watilde committed Mar 2, 2018
1 parent 81d73fe commit c05c73a
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/parallel/test-fs-promises.js
Expand Up @@ -9,8 +9,10 @@ const fsPromises = require('fs/promises');
const {
access,
chmod,
chown,
copyFile,
fchmod,
fchown,
fdatasync,
fstat,
fsync,
Expand All @@ -27,6 +29,8 @@ const {
realpath,
rename,
rmdir,
lchmod,
lchown,
stat,
symlink,
write,
Expand Down Expand Up @@ -95,6 +99,21 @@ function verifyStatObject(stat) {

await chmod(dest, 0o666);
await fchmod(handle, 0o666);
// lchmod is only available on OSX
if (common.isOSX) {
await lchmod(dest, 0o666);
}

if (!common.isWindows) {
const gid = process.getgid();
const uid = process.getuid();
await chown(dest, uid, gid);
await fchown(handle, uid, gid);
// lchown is only available on OSX
if (common.isOSX) {
await lchown(dest, uid, gid);
}
}

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

Expand Down

0 comments on commit c05c73a

Please sign in to comment.