From 317cee563669c6b1cee77e2f4152841493543894 Mon Sep 17 00:00:00 2001 From: Oleksii Polovyi Date: Tue, 5 Feb 2019 14:20:48 -0500 Subject: [PATCH] Fix issue #672 : Refactor "filer/tests/spec/fs.mkdir.spec.js" to follow ES6 syntax with "const/let" instead of "var" (#722) * Solution for issue-672 * Removed extra 'use strict'; --- tests/spec/fs.mkdir.spec.js | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/tests/spec/fs.mkdir.spec.js b/tests/spec/fs.mkdir.spec.js index 116dd6b..84b25d6 100644 --- a/tests/spec/fs.mkdir.spec.js +++ b/tests/spec/fs.mkdir.spec.js @@ -1,17 +1,18 @@ -var util = require('../lib/test-utils.js'); -var expect = require('chai').expect; +'use strict'; +const util = require('../lib/test-utils.js'); +const expect = require('chai').expect; describe('fs.mkdir', function () { beforeEach(util.setup); afterEach(util.cleanup); it('should be a function', function () { - var fs = util.fs(); + const fs = util.fs(); expect(fs.mkdir).to.be.a('function'); }); it('should return an error if part of the parent path does not exist', function (done) { - var fs = util.fs(); + const fs = util.fs(); fs.mkdir('/tmp/mydir', function (error) { expect(error).to.exist; @@ -21,7 +22,7 @@ describe('fs.mkdir', function () { }); it('should return an error if the path already exists', function (done) { - var fs = util.fs(); + const fs = util.fs(); fs.mkdir('/', function (error) { expect(error).to.exist; @@ -31,7 +32,7 @@ describe('fs.mkdir', function () { }); it('should make a new directory', function (done) { - var fs = util.fs(); + const fs = util.fs(); fs.mkdir('/tmp', function (error) { expect(error).not.to.exist; @@ -52,12 +53,12 @@ describe('fs.promises.mkdir', function () { afterEach(util.cleanup); it('should be a function', function () { - var fs = util.fs(); + const fs = util.fs(); expect(fs.promises.mkdir).to.be.a('function'); }); it('should return an error if part of the parent path does not exist', function () { - var fs = util.fs(); + const fs = util.fs(); return fs.promises.mkdir('/tmp/mydir') .catch(error => { @@ -67,7 +68,7 @@ describe('fs.promises.mkdir', function () { }); it('should return an error if the path already exists', function () { - var fs = util.fs(); + const fs = util.fs(); return fs.promises.mkdir('/') .catch(error =>{ @@ -77,7 +78,7 @@ describe('fs.promises.mkdir', function () { }); it('should make a new directory', function () { - var fs = util.fs(); + const fs = util.fs(); return fs.promises.mkdir('/tmp') .then(() => fs.promises.stat('/tmp')) @@ -88,7 +89,7 @@ describe('fs.promises.mkdir', function () { }); it('should return a promise', function () { - var fs = util.fs(); + const fs = util.fs(); expect(fs.promises.mkdir('/tmp')).to.be.a('promise'); }); }); \ No newline at end of file