Moved fs constants under constants as per documentation and added tests for access and accessSync

This commit is contained in:
Alejandro Sánchez
2016-09-06 14:12:51 -06:00
parent 03f3ca4333
commit 69089fffa5
2 changed files with 33 additions and 8 deletions

View File

@@ -165,6 +165,22 @@ fs.watch('/tmp/foo-', {
console.log(event, filename);
});
fs.access('/path/to/folder', (err) => {});
fs.access(Buffer.from(''), (err) => {});
fs.access('/path/to/folder', fs.constants.F_OK | fs.constants.R_OK, (err) => {});
fs.access(Buffer.from(''), fs.constants.F_OK | fs.constants.R_OK, (err) => {});
fs.accessSync('/path/to/folder');
fs.accessSync(Buffer.from(''));
fs.accessSync('path/to/folder', fs.constants.W_OK | fs.constants.X_OK);
fs.accessSync(Buffer.from(''), fs.constants.W_OK | fs.constants.X_OK);
///////////////////////////////////////////////////////
/// Buffer tests : https://nodejs.org/api/buffer.html
///////////////////////////////////////////////////////