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:
parent
389dedd3c0
commit
c33f22b464
|
@ -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');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
Loading…
Reference in New Issue