* Fix #419: Add test for fsPromises.open() when the path does not exist * Update package.json * Fix #419: Add test for fsPromises.open() when the path does not exist Removed some unnecessary code based on reviews * Update fs.open.spec.js
This commit is contained in:
parent
c7ea45a18b
commit
934ef8bfa7
|
@ -137,3 +137,22 @@ describe('fs.open', function() {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* fsPromise.open() Tests
|
||||||
|
**/
|
||||||
|
describe('fsPromises.open', function() {
|
||||||
|
beforeEach(util.setup);
|
||||||
|
afterEach(util.cleanup);
|
||||||
|
|
||||||
|
it('should return an error if the parent path does not exist', function() {
|
||||||
|
var fsPromises = util.fs().promises;
|
||||||
|
|
||||||
|
return fsPromises.open('/tmp/myfile', 'w+')
|
||||||
|
.then(result => expect(result).not.to.exist)
|
||||||
|
.catch(error => {
|
||||||
|
expect(error).to.exist;
|
||||||
|
expect(error.code).to.equal('ENOENT');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
Loading…
Reference in New Issue