Fixed issue#480 using promises to test fs.truncate when path does not exist (#516)
* added a test for issue#480 using promises to test fs.truncate * Fixed issue#480 tesing fs.truncate using promises when path does not exist
This commit is contained in:
parent
0354c7e13e
commit
2e2e2f9d64
|
@ -223,3 +223,18 @@ describe('fs.truncate', function() {
|
|||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
describe('fsPromises.truncate', function () {
|
||||
beforeEach(util.setup);
|
||||
afterEach(util.cleanup);
|
||||
it('should error when path does not exist (with promises)', () => {
|
||||
var fsPromises = util.fs().promises;
|
||||
|
||||
return fsPromises.truncate('/NonExistingPath', 0)
|
||||
.catch(error => {
|
||||
expect(error).to.exist;
|
||||
expect(error.code).to.equal('ENOENT');
|
||||
});
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue