From 9a7d3514d831c7cc1c5e980649c578641ed16b59 Mon Sep 17 00:00:00 2001 From: qwang135 Date: Mon, 24 Sep 2018 22:47:52 -0400 Subject: [PATCH] Fix #514: add test for fsPromises.lstat with directory Co-authored-by: David Humphrey --- tests/spec/fs.lstat.spec.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/spec/fs.lstat.spec.js b/tests/spec/fs.lstat.spec.js index e3fba5d..c6cb470 100644 --- a/tests/spec/fs.lstat.spec.js +++ b/tests/spec/fs.lstat.spec.js @@ -48,7 +48,7 @@ describe('fs.lstat', function() { }); }); -describe('fs.promises.lstat', ()=> { +describe('fs.promises.lstat', () => { beforeEach(util.setup); afterEach(util.cleanup); @@ -61,6 +61,14 @@ describe('fs.promises.lstat', ()=> { 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; + }); + }); }); - -