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

Fixed #665: Replaced var with let or const and added strict mode fs.a… #688

Merged
merged 3 commits into from
Jan 31, 2019
Merged

Fixed #665: Replaced var with let or const and added strict mode fs.a… #688

merged 3 commits into from
Jan 31, 2019

Conversation

ithompson4
Copy link
Contributor

Updated the code in filer/tests/spec/fs.access.spec.js to fix issue #665:

  • replaced var with let and const
  • added strict mode

@codecov-io
Copy link

codecov-io commented Jan 28, 2019

Codecov Report

Merging #688 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #688   +/-   ##
=======================================
  Coverage   86.71%   86.71%           
=======================================
  Files          16       16           
  Lines        1746     1746           
=======================================
  Hits         1514     1514           
  Misses        232      232
Impacted Files Coverage Δ
src/shell/environment.js 100% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 26b47ee...0f38a4e. Read the comment docs.

tests/spec/fs.access.spec.js Outdated Show resolved Hide resolved
tests/spec/fs.access.spec.js Outdated Show resolved Hide resolved
tests/spec/fs.access.spec.js Outdated Show resolved Hide resolved
Copy link
Contributor

@humphd humphd left a comment

Choose a reason for hiding this comment

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

This is looking good. What you have is correct, but you can actually change all your let statements to const, since they are for variables that won't change their values ever.

Can you do that for me, and push up another commit? When that's done, let me know and I'll re-review this and hopefully we can merge.

@@ -41,8 +43,8 @@ describe('fs.access', function () {
});

it('should return no error if file does exist and mode = F_OK', function (done) {
var fs = util.fs();
var contents = 'This is a file.';
let 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.

You can follow the same pattern as above, and use const here, since fs won't change during the scope of this function.

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 replaced all let statements with const and pushed another commit.

Copy link
Contributor

@humphd humphd left a comment

Choose a reason for hiding this comment

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

Perfect!

@humphd humphd merged commit 3f619fd into filerjs:master Jan 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants