Issue497 Add test for fs.chmod when the path is invalid (#525)

* Fix #497 Add test for fs.chmod when the path is invalid

* Fix #497 All test passed
This commit is contained in:
yuzhouChen 2018-10-09 14:30:36 -07:00 committed by David Humphrey
parent 27659d45da
commit 8504cc7e2a
1 changed files with 10 additions and 0 deletions

View File

@ -39,6 +39,16 @@ describe('fs.chmod, fs.fchmod', function() {
});
});
it('should be an error when the path is invalid', function(done){
var fs = util.fs();
fs.chmod('/invalid_path', 0o444, function(err){
expect(err).to.exist;
expect(err.code).to.equal('ENOENT');
done();
});
});
it('should allow for updating mode of a given file', function(done) {
var fs = util.fs();