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

Conversation

Projects
None yet
4 participants
@ithompson4
Copy link
Contributor

ithompson4 commented Jan 28, 2019

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

This comment has been minimized.

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.

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 tests/spec/fs.access.spec.js Outdated
@humphd
Copy link
Contributor

humphd left a comment

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();

This comment has been minimized.

@humphd

humphd Jan 31, 2019

Contributor

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

This comment has been minimized.

@ithompson4

ithompson4 Jan 31, 2019

Author Contributor

I replaced all let statements with const and pushed another commit.

@humphd

humphd approved these changes Jan 31, 2019

Copy link
Contributor

humphd left a comment

Perfect!

@humphd humphd merged commit 3f619fd into filerjs:master Jan 31, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.