-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
added template for better error explanation to assert.ok error message #16829
Conversation
@@ -16,7 +16,7 @@ const args = [ | |||
{ | |||
const ret = spawnSync(process.execPath, args, { maxBuffer: 1 }); | |||
|
|||
assert.ok(ret.error, 'maxBuffer should error'); | |||
assert.ok(ret.error, `instead of an error there is ${ret.error}` ); |
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.
Since ret
is returned by spawnSync
, ret.error
can only be either an Error
or undefined
, so if it fails this would always be "instead of an error there is undefined", which does not seem very helpful... I think changing the message to child process does not error when maxBuffer is set to 1
would be easier to understand.
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.
Good point, thank you
…ned: "child process does not error when maxBuffer is set to 1"
@@ -16,7 +16,8 @@ const args = [ | |||
{ | |||
const ret = spawnSync(process.execPath, args, { maxBuffer: 1 }); | |||
|
|||
assert.ok(ret.error, 'maxBuffer should error'); | |||
assert.ok(ret.error, 'child process does not error \ | |||
when maxBuffer is set to 1'); |
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.
this your last commit introduced non-standard indentations. Please will you correct it? The previous commit was fair enough, dont know why you pushed again
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.
thanks for the review. Sorry, that I have to change it again. I only wanted to fix the error that the linter was throwing, where i exceeded the maximum line length of 80.
Now that you pushed a commit while the CI was running (which would have picked up the older / newer commit depending on the timing of the push), the CI result is going to be inconclusive ping @Trott to confirm if that is the case. |
Hi @chrbergert! Thanks for the PR and welcome. A few things:
So, a few things:
assert.ok(ret.error,
'child process does not error when maxBuffer is set to 1'); I think I'd prefer this: assert.ok(ret.error, 'error expected when maxBuffer is set to 1');
// This test checks that the maxBuffer option for child_process.spawnSync()
// works as expected. |
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.
requesting changes in comment above
- removed comment that wasn't relevant/important - added comment that explains what the test does
Hi together, first of all, thanks for all the input and the warm welcome.
Before I ran lint-js locally and experimented a bit with it. Think I got the process for this, finally. So, hope it goes through now and thanks again helping me doing my first contribution to this awesome project. |
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.
(When landing, we'll need to be careful to make sure the commit message accurately reflects the change.)
CI was good except for Raspberry Pi devices which have (had?) been having build problems. Let's try again: https://ci.nodejs.org/job/node-test-commit-arm-fanned/12541/ |
Landed in 21a7459. |
* remove comment that isn't relevant/important * add comment that explains what the test does PR-URL: nodejs#16829 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
* remove comment that isn't relevant/important * add comment that explains what the test does PR-URL: #16829 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
* remove comment that isn't relevant/important * add comment that explains what the test does PR-URL: #16829 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
* remove comment that isn't relevant/important * add comment that explains what the test does PR-URL: #16829 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
* remove comment that isn't relevant/important * add comment that explains what the test does PR-URL: #16829 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
* remove comment that isn't relevant/important * add comment that explains what the test does PR-URL: #16829 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)