-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
test: improve code in test-fs-write-file-sync #10624
Conversation
|
||
fs.writeFileSync(file1, '123', {mode: mode}); | ||
|
||
content = fs.readFileSync(file1, {encoding: 'utf8'}); | ||
assert.equal('123', content); | ||
assert.strictEqual('123', content); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: can you please swap the arguments here and throughout the rest of the file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM subject to fixing nit mentioned by last reviewer
c4de8c6
to
f56a1c3
Compare
|
||
assert.equal(mode, fs.statSync(file1).mode & 0o777); | ||
assert.strictEqual(mode, fs.statSync(file1).mode & 0o777); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: can you also please swap the arguments here?
* use let and const instead of var * use assert.strictEqual instead of assert.equal * swap assertions arguments to match the standard
f56a1c3
to
7de6d49
Compare
@lpinca, changed those |
Landed in 8a12368. |
* use let and const instead of var * use assert.strictEqual instead of assert.equal * swap assertions arguments to match the standard PR-URL: #10624 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
* use let and const instead of var * use assert.strictEqual instead of assert.equal * swap assertions arguments to match the standard PR-URL: nodejs#10624 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
* use let and const instead of var * use assert.strictEqual instead of assert.equal * swap assertions arguments to match the standard PR-URL: nodejs#10624 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
* use let and const instead of var * use assert.strictEqual instead of assert.equal * swap assertions arguments to match the standard PR-URL: #10624 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
* use let and const instead of var * use assert.strictEqual instead of assert.equal * swap assertions arguments to match the standard PR-URL: nodejs#10624 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
* use let and const instead of var * use assert.strictEqual instead of assert.equal * swap assertions arguments to match the standard PR-URL: nodejs#10624 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
This will need a backport PR to land on v4 |
* use let and const instead of var * use assert.strictEqual instead of assert.equal * swap assertions arguments to match the standard PR-URL: #10624 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
* use let and const instead of var * use assert.strictEqual instead of assert.equal * swap assertions arguments to match the standard PR-URL: #10624 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test