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
This commit is contained in:
parent
f2201e7a74
commit
e6f8ef2251
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue