-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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: cleanup test-child-process-stdio.js #8584
test: cleanup test-child-process-stdio.js #8584
Conversation
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 with a nit. Can you please add a description of change into the commit message and refer to the code and lean issue.
- refactor vars to const and let issue: nodejs/code-and-learn#56(comment) modified file: test/parallel/test-child-process-stdio.js refactor variable declaration "var common" to "const common" refactor variable declaration "var assert" to "const assert" refactor variable declaration "var options" to "let options" refactor variable declaration "var child" to "let child"
118807c
to
f8f92e4
Compare
Added a more detailed description of change into the commit message, referring to the source code and the git issue. |
var options = {stdio: ['pipe']}; | ||
var child = common.spawnPwd(options); | ||
let options = {stdio: ['pipe']}; | ||
let child = common.spawnPwd(options); | ||
|
||
assert.notEqual(child.stdout, null); | ||
assert.notEqual(child.stderr, null); |
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.
You can change assert.notStrictEqual
and assert.strictEqual
in this test file, too :)
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.
@addaleax If i understood that correctly:
Do you mean that i should replace equal with strictEqual
and replace notEqual with notStrictEqual
?
In that case will there be any inconsistencies because of the fact that the assertions in this file are against null and:
undefined === null // equals false
undefined !== null // equals true
For example:
assert.notStrictEqual(undefined, null) // this will pass
assert.strictEqual(undefined, null) // this will not pass
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.
@pmatzavin Sorry for the late reply! Yes, that’s what I meant. Just to be clear, notStrictEqual
corresponds to !==
and strictEqual
to ===
, and we usually do want the strict tests exactly to catch things like accidentally relying on undefined == null
.
issue: nodejs/code-and-learn#56(comment) modified file: test/parallel/test-child-process-stdio.js Replace the equal assetion with strictEqual. Replace the notEqual assertion with strictNotEqual.
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
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
Refs: nodejs/code-and-learn#56(comment) Replace the equal assetion with strictEqual. Replace the notEqual assertion with strictNotEqual. PR-URL: #8584 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Robert Jefe Lindstaedt <[email protected]>
Landed in 078bf68. Thank you! |
Refs: nodejs/code-and-learn#56(comment) Replace the equal assetion with strictEqual. Replace the notEqual assertion with strictNotEqual. PR-URL: #8584 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Robert Jefe Lindstaedt <[email protected]>
Refs: nodejs/code-and-learn#56(comment) Replace the equal assetion with strictEqual. Replace the notEqual assertion with strictNotEqual. PR-URL: #8584 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Robert Jefe Lindstaedt <[email protected]>
Checklist
make -j4 test
(UNIX), orvcbuild test nosign
(Windows) passesAffected core subsystem(s)
Description of change
issue: nodejs/code-and-learn#56(comment)
modified file: test/parallel/test-child-process-stdio.js
refactor variable declaration "var common" to "const common"
refactor variable declaration "var assert" to "const assert"
refactor variable declaration "var options" to "let options"
refactor variable declaration "var child" to "let child"