Add a mkdir test that uses promises as well

This commit is contained in:
David Humphrey (:humph) david.humphrey@senecacollege.ca 2018-09-20 18:47:46 -04:00
parent 07eb047213
commit e3a2187a54
1 changed files with 12 additions and 0 deletions

View File

@ -82,4 +82,16 @@ describe('fs.mkdir', function() {
});
});
it('should create all paths if {recursive:true} is specified on a deep path (promises)', () => {
let fsPromises = util.fs().promises;
return fsPromises
.mkdir('/tmp/deep/path', {recursive:true})
.then(() => fsPromises.stat('/tmp/deep/path'))
.then(stats => {
expect(stats).to.exist;
expect(stats.type).to.equal('DIRECTORY');
});
});
});