Fix #456 - add test for fs.write() with undefined path

This commit is contained in:
Dan Lin 2018-09-24 16:46:47 -04:00 committed by David Humphrey
parent 443b582038
commit 4a5d8c1222
1 changed files with 12 additions and 0 deletions

View File

@ -5,6 +5,18 @@ describe('fs.write', function() {
beforeEach(util.setup);
afterEach(util.cleanup);
// if the file is undefined, it will create problems
//
it('should be a error',function(done){
var fs=util.fs();
fs.writeFile(undefined, 'data', function(error) {
expect(error).to.exist;
expect(error.code).to.equal('EINVAL');
done();
});
});
it('should be a function', function() {
var fs = util.fs();
expect(fs.write).to.be.a('function');