From e6f8ef225133c4d362d66e9008ca44d696cdeed7 Mon Sep 17 00:00:00 2001 From: hoaianhkhang <46699312+hoaianhkhang@users.noreply.github.com> Date: Tue, 12 Feb 2019 14:49:20 -0500 Subject: [PATCH] Issue #715 Update fs.lstat.spec.js to have proper const and let instead of var and added 'use strict' (#727) * Update fs.lstat.spec.js * Update fs.lstat.spec.js * Update fs.lstat.spec.js * Update fs.lstat.spec.js * Update fs.lstat.spec.js * Update fs.lstat.spec.js * Update fs.lstat.spec.js --- tests/spec/fs.lstat.spec.js | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/tests/spec/fs.lstat.spec.js b/tests/spec/fs.lstat.spec.js index 8e9af91..24711be 100644 --- a/tests/spec/fs.lstat.spec.js +++ b/tests/spec/fs.lstat.spec.js @@ -1,18 +1,19 @@ -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.lstat', function() { beforeEach(util.setup); afterEach(util.cleanup); it('should be a function', function() { - var fs = util.fs(); + const fs = util.fs(); expect(typeof fs.lstat).to.equal('function'); }); it('should return an error if path does not exist', function(done) { - var fs = util.fs(); - + const fs = util.fs(); + fs.lstat('/tmp', function(error, result) { expect(error).to.exist; expect(error.code).to.equal('ENOENT'); @@ -22,8 +23,8 @@ describe('fs.lstat', function() { }); it('should return a stat object if path is not a symbolic link', function(done) { - var fs = util.fs(); - + const fs = util.fs(); + fs.lstat('/', function(error, result) { expect(error).not.to.exist; expect(result).to.exist; @@ -33,8 +34,8 @@ describe('fs.lstat', function() { }); it('should return a stat object if path is a symbolic link', function(done) { - var fs = util.fs(); - + const fs = util.fs(); + fs.symlink('/', '/mylink', function(error) { if(error) throw error; @@ -74,7 +75,7 @@ describe('fs.promises.lstat', () => { afterEach(util.cleanup); it('should return an error if path does not exist', () => { - var fsPromises = util.fs().promises; + const fsPromises = util.fs().promises; return fsPromises.lstat('/tmp') .catch( error => { @@ -84,8 +85,8 @@ describe('fs.promises.lstat', () => { }); it('should return a stat object if path is not a symbolic link', () => { - var fsPromises = util.fs().promises; - + const fsPromises = util.fs().promises; + return fsPromises.lstat('/') .then(result => { expect(result).to.exist;