Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #715 Update fs.lstat.spec.js to have proper const and let instead of var and added 'use strict' #727

Merged
merged 7 commits into from Feb 12, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 13 additions & 12 deletions 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();

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove all these blank lines? It's normally a bad idea to touch lines that aren't really part of this fix. The reason it's generally avoided is that it will alter the history of these lines in git, making them look like they were changed in this PR, but really they weren't.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have changed the file again with the space

const fs = util.fs();
fs.lstat('/tmp', function(error, result) {
expect(error).to.exist;
expect(error.code).to.equal('ENOENT');
Expand All @@ -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;
Expand All @@ -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;

Expand All @@ -53,7 +54,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 => {
Expand All @@ -63,8 +64,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;
Expand Down