Issue 396 - Add a test for fs.promises.stat() when the path does not exist (#406)

* test non exist path for promise

* fix new line at the end

* fix missing semicolon 113:26

* follow 'Testing promise codes' on guidline
This commit is contained in:
pynnl 2018-10-09 17:40:35 -04:00 committed by David Humphrey
parent 389dedd3c0
commit c33f22b464
1 changed files with 19 additions and 0 deletions

View File

@ -121,3 +121,22 @@ describe('fs.stat', function() {
});
});
});
/**
* fsPromises tests
*/
describe('fsPromises.stat', function() {
beforeEach(util.setup);
afterEach(util.cleanup);
it('should return an error if path does not exist', function() {
var fsPromises = util.fs().promises;
return fsPromises.stat('/tmp')
.catch(error => {
expect(error).to.exist;
expect(error.code).to.equal('ENOENT');
});
});
});