From 8504cc7e2ac05b35f27799bb7f12da65fac89a2f Mon Sep 17 00:00:00 2001 From: yuzhouChen Date: Tue, 9 Oct 2018 14:30:36 -0700 Subject: [PATCH] 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 --- tests/spec/fs.chmod.spec.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/spec/fs.chmod.spec.js b/tests/spec/fs.chmod.spec.js index 090d98b..40050ce 100644 --- a/tests/spec/fs.chmod.spec.js +++ b/tests/spec/fs.chmod.spec.js @@ -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();