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 #708: Added 'use strict' and replaced var with let/const in fs.appendFile.spec.js #713

Merged
merged 7 commits into from
Jan 31, 2019

Conversation

DavidLi119
Copy link
Contributor

@DavidLi119 DavidLi119 commented Jan 30, 2019

Added 'use strict' at the top of the file, then replaced var with const:

var ex = 'unchanging';
// change to
const ex = 'unchanging';

Same with let:

var ex = run();
// change to
let ex = run();

@codecov-io
Copy link

codecov-io commented Jan 30, 2019

Codecov Report

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

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #713   +/-   ##
=======================================
  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...64ddef1. Read the comment docs.


describe('fs.appendFile', function() {
const contents = 'This is a file.';

beforeEach(function(done) {
util.setup(function() {
var fs = util.fs();
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.

This could probably be const

@@ -16,13 +18,13 @@ describe('fs.appendFile', function() {
afterEach(util.cleanup);

it('should be a function', function() {
var fs = util.fs();
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.

Suggested change
let fs = util.fs();
const fs = util.fs();

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.

You can change all your lets to const in this file, since none of the variables are changing after you declare them.

Otherwise, this looks good. Nice work. Let me know when you've done this so I can re-review.

This reverts commit 8aa5cbb.
As informed, all variables will not change at all in this file, therefore all `let` declarations have been changed to `const`
@DavidLi119
Copy link
Contributor Author

Made all changes that were requested professor. Also, I didn't realize that committing via VSC would commit to github as well, hence the 1 letter commit name at first. I reverted and recommitted properly.

@humphd
Copy link
Contributor

humphd commented Jan 31, 2019

@DavidLi119 I see you've pushed a new commit, and wanted to fix your commit message. Here's a tip:

git commit --amend -m "New commit message"

The --amend will add/to, update, etc. the old commit with whatever you add, which can be as simple as the commit message changing.

@DavidLi119
Copy link
Contributor Author

Ah, thanks for the recommendation, I will keep it in mind for next time.

@humphd humphd merged commit 8751399 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.

3 participants