Skip to content

Commit

Permalink
Issue 396 - Add a test for fs.promises.stat() when the path does not …
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
tienpv222 authored and humphd committed Oct 9, 2018
1 parent 389dedd commit c33f22b
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/spec/fs.stat.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
});
});

0 comments on commit c33f22b

Please sign in to comment.