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';
This commit is contained in:
Oleksii Polovyi 2019-02-05 14:20:48 -05:00 committed by David Humphrey
parent 3c51bbb24f
commit 317cee5636
1 changed files with 12 additions and 11 deletions

View File

@ -1,17 +1,18 @@
var util = require('../lib/test-utils.js'); 'use strict';
var expect = require('chai').expect; const util = require('../lib/test-utils.js');
const expect = require('chai').expect;
describe('fs.mkdir', function () { describe('fs.mkdir', function () {
beforeEach(util.setup); beforeEach(util.setup);
afterEach(util.cleanup); afterEach(util.cleanup);
it('should be a function', function () { it('should be a function', function () {
var fs = util.fs(); const fs = util.fs();
expect(fs.mkdir).to.be.a('function'); expect(fs.mkdir).to.be.a('function');
}); });
it('should return an error if part of the parent path does not exist', function (done) { 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) { fs.mkdir('/tmp/mydir', function (error) {
expect(error).to.exist; expect(error).to.exist;
@ -21,7 +22,7 @@ describe('fs.mkdir', function () {
}); });
it('should return an error if the path already exists', function (done) { it('should return an error if the path already exists', function (done) {
var fs = util.fs(); const fs = util.fs();
fs.mkdir('/', function (error) { fs.mkdir('/', function (error) {
expect(error).to.exist; expect(error).to.exist;
@ -31,7 +32,7 @@ describe('fs.mkdir', function () {
}); });
it('should make a new directory', function (done) { it('should make a new directory', function (done) {
var fs = util.fs(); const fs = util.fs();
fs.mkdir('/tmp', function (error) { fs.mkdir('/tmp', function (error) {
expect(error).not.to.exist; expect(error).not.to.exist;
@ -52,12 +53,12 @@ describe('fs.promises.mkdir', function () {
afterEach(util.cleanup); afterEach(util.cleanup);
it('should be a function', function () { it('should be a function', function () {
var fs = util.fs(); const fs = util.fs();
expect(fs.promises.mkdir).to.be.a('function'); expect(fs.promises.mkdir).to.be.a('function');
}); });
it('should return an error if part of the parent path does not exist', 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') return fs.promises.mkdir('/tmp/mydir')
.catch(error => { .catch(error => {
@ -67,7 +68,7 @@ describe('fs.promises.mkdir', function () {
}); });
it('should return an error if the path already exists', function () { it('should return an error if the path already exists', function () {
var fs = util.fs(); const fs = util.fs();
return fs.promises.mkdir('/') return fs.promises.mkdir('/')
.catch(error =>{ .catch(error =>{
@ -77,7 +78,7 @@ describe('fs.promises.mkdir', function () {
}); });
it('should make a new directory', function () { it('should make a new directory', function () {
var fs = util.fs(); const fs = util.fs();
return fs.promises.mkdir('/tmp') return fs.promises.mkdir('/tmp')
.then(() => fs.promises.stat('/tmp')) .then(() => fs.promises.stat('/tmp'))
@ -88,7 +89,7 @@ describe('fs.promises.mkdir', function () {
}); });
it('should return a promise', function () { it('should return a promise', function () {
var fs = util.fs(); const fs = util.fs();
expect(fs.promises.mkdir('/tmp')).to.be.a('promise'); expect(fs.promises.mkdir('/tmp')).to.be.a('promise');
}); });
}); });