-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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: increase coverage of process.emitWarning #9556
test: increase coverage of process.emitWarning #9556
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
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
@@ -24,6 +26,10 @@ function CustomWarning() { | |||
util.inherits(CustomWarning, Error); | |||
process.emitWarning(new CustomWarning()); | |||
|
|||
const warningNoToString = new CustomWarning(); | |||
warningNoToString.toString = 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.
I wonder if we should also handle cases where toString()
is a function but throws?
a10be3b
to
179cd0f
Compare
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.
Yup, still LGTM :)
179cd0f
to
9e698bd
Compare
Previously our tests did not check these codepaths as seen at coverage.nodejs.org PR-URL: #9556 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Previously our tests did not check these codepaths as seen at coverage.nodejs.org PR-URL: nodejs#9556 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Previously our tests did not check these codepaths as seen at coverage.nodejs.org PR-URL: #9556 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Checklist
make -j8 test
(UNIX), orvcbuild test nosign
(Windows) passesAffected core subsystem(s)
test, process
Description of change
Previously our tests did not check these codepaths as seen at
coverage.nodejs.org
See https://coverage.nodejs.org/coverage-fb05e31466ac0bad/root/internal/process/warning.js.html
Ci: https://ci.nodejs.org/job/node-test-pull-request/4825/
(This patch was made live during https://www.twitch.tv/nodesource/v/100431274 if you'd like to see me working on this in retrospect. :P)