replaced var with let

This commit is contained in:
Priyanka Dhiman 2019-01-30 22:27:11 -05:00
parent 26b47ee094
commit 7cdef6d963
1 changed files with 10 additions and 10 deletions

View File

@ -1,18 +1,18 @@
var util = require('../lib/test-utils.js'); let util = require('../lib/test-utils.js');
var expect = require('chai').expect; let expect = require('chai').expect;
describe('fs.unlink', function() { describe('fs.unlink', 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(); let fs = util.fs();
expect(fs.unlink).to.be.a('function'); expect(fs.unlink).to.be.a('function');
}); });
it('should remove a link to an existing file', function(done) { it('should remove a link to an existing file', function(done) {
var fs = util.fs(); let fs = util.fs();
var complete1, complete2; let complete1, complete2;
function maybeDone() { function maybeDone() {
if(complete1 && complete2) { if(complete1 && complete2) {
@ -53,7 +53,7 @@ describe('fs.unlink', function() {
}); });
it('should not follow symbolic links', function(done) { it('should not follow symbolic links', function(done) {
var fs = util.fs(); let fs = util.fs();
fs.symlink('/', '/myFileLink', function (error) { fs.symlink('/', '/myFileLink', function (error) {
if (error) throw error; if (error) throw error;
@ -85,7 +85,7 @@ describe('fs.unlink', function() {
}); });
it('should not unlink directories', function (done) { it('should not unlink directories', function (done) {
var fs = util.fs(); let fs = util.fs();
fs.mkdir('/mydir', function (error) { fs.mkdir('/mydir', function (error) {
if(error) throw error; if(error) throw error;
@ -110,12 +110,12 @@ describe('fs.promises.unlink', function () {
afterEach(util.cleanup); afterEach(util.cleanup);
it('should be a function', function () { it('should be a function', function () {
var fs = util.fs(); let fs = util.fs();
expect(fs.promises.unlink).to.be.a('function'); expect(fs.promises.unlink).to.be.a('function');
}); });
it('should return an error if trying to delete a file that does not exist', function() { it('should return an error if trying to delete a file that does not exist', function() {
var fsPromises = util.fs().promises; let fsPromises = util.fs().promises;
return fsPromises.unlink('/myFile') return fsPromises.unlink('/myFile')
.catch(error => { .catch(error => {
@ -125,7 +125,7 @@ describe('fs.promises.unlink', function () {
}); });
it('should not unlink directories', () => { it('should not unlink directories', () => {
var fs = util.fs().promises; let fs = util.fs().promises;
return fs.mkdir('/mydir') return fs.mkdir('/mydir')
.then(() => fs.unlink('/mydir')) .then(() => fs.unlink('/mydir'))