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');
|
'use strict';
|
||||||
var expect = require('chai').expect;
|
const util = require('../lib/test-utils.js');
|
||||||
|
const expect = require('chai').expect;
|
||||||
|
|
||||||
describe('fs.lstat', function() {
|
describe('fs.lstat', 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(typeof fs.lstat).to.equal('function');
|
expect(typeof fs.lstat).to.equal('function');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should return an error if path does not exist', function(done) {
|
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) {
|
fs.lstat('/tmp', function(error, result) {
|
||||||
expect(error).to.exist;
|
expect(error).to.exist;
|
||||||
expect(error.code).to.equal('ENOENT');
|
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) {
|
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) {
|
fs.lstat('/', function(error, result) {
|
||||||
expect(error).not.to.exist;
|
expect(error).not.to.exist;
|
||||||
expect(result).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) {
|
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) {
|
fs.symlink('/', '/mylink', function(error) {
|
||||||
if(error) throw error;
|
if(error) throw error;
|
||||||
|
|
||||||
|
@ -74,7 +75,7 @@ describe('fs.promises.lstat', () => {
|
||||||
afterEach(util.cleanup);
|
afterEach(util.cleanup);
|
||||||
|
|
||||||
it('should return an error if path does not exist', () => {
|
it('should return an error if path does not exist', () => {
|
||||||
var fsPromises = util.fs().promises;
|
const fsPromises = util.fs().promises;
|
||||||
|
|
||||||
return fsPromises.lstat('/tmp')
|
return fsPromises.lstat('/tmp')
|
||||||
.catch( error => {
|
.catch( error => {
|
||||||
|
@ -84,8 +85,8 @@ describe('fs.promises.lstat', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should return a stat object if path is not a symbolic link', () => {
|
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('/')
|
return fsPromises.lstat('/')
|
||||||
.then(result => {
|
.then(result => {
|
||||||
expect(result).to.exist;
|
expect(result).to.exist;
|
||||||
|
|
Loading…
Reference in New Issue