Fix #514: add test for fsPromises.lstat with directory

Co-authored-by: David Humphrey <david.humphrey@senecacollege.ca>
This commit is contained in:
qwang135 2018-09-24 22:47:52 -04:00 committed by David Humphrey
parent 848cc7d3de
commit 9a7d3514d8
1 changed files with 11 additions and 3 deletions

View File

@ -48,7 +48,7 @@ describe('fs.lstat', function() {
}); });
}); });
describe('fs.promises.lstat', ()=> { describe('fs.promises.lstat', () => {
beforeEach(util.setup); beforeEach(util.setup);
afterEach(util.cleanup); afterEach(util.cleanup);
@ -61,6 +61,14 @@ describe('fs.promises.lstat', ()=> {
expect(error.code).to.equal('ENOENT'); expect(error.code).to.equal('ENOENT');
}); });
}); });
it('should return a stat object if path is not a symbolic link', () => {
var fsPromises = util.fs().promises;
return fsPromises.lstat('/')
.then(result => {
expect(result).to.exist;
expect(result.isDirectory()).to.be.true;
});
});
}); });