From e3a2187a542e4d15adbeb9bcdb4d5aed9e42e1fa Mon Sep 17 00:00:00 2001 From: "David Humphrey (:humph) david.humphrey@senecacollege.ca" Date: Thu, 20 Sep 2018 18:47:46 -0400 Subject: [PATCH] Add a mkdir test that uses promises as well --- tests/spec/fs.mkdir.spec.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/spec/fs.mkdir.spec.js b/tests/spec/fs.mkdir.spec.js index 87b1f66..e3ea44c 100644 --- a/tests/spec/fs.mkdir.spec.js +++ b/tests/spec/fs.mkdir.spec.js @@ -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'); + }); + }); + });