diff --git a/tests/spec/fs.open.spec.js b/tests/spec/fs.open.spec.js index b995755..685a27d 100644 --- a/tests/spec/fs.open.spec.js +++ b/tests/spec/fs.open.spec.js @@ -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'); + }); + }); +});