-
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: favor assertions over console logging #11547
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.
test/common.js
Outdated
@@ -402,8 +402,7 @@ process.on('exit', function() { | |||
if (!exports.globalCheck) return; | |||
const leaked = leakedGlobals(); | |||
if (leaked.length > 0) { | |||
console.error('Unknown globals: %s', leaked); | |||
fail('Unknown global found'); | |||
fail(`Unexpected global(s) found: ${leaked}`); |
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.
While at it, maybe this can also use some better formatting? Like
fail(`Unexpected global(s) found: ${leaked.join(', ')}`);
Communicate about leaked globals via `AssertionError` rather than `console.log()`.
Communicate about leaked globals via `AssertionError` rather than `console.log()`. PR-URL: #11547 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
Landed in 12de99d... I just realized that I landed this without a CI run tho. Should be ok but here is one just in case: https://ci.nodejs.org/job/node-test-pull-request/6606/ |
Communicate about leaked globals via `AssertionError` rather than `console.log()`. PR-URL: nodejs#11547 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
Communicate about leaked globals via `AssertionError` rather than `console.log()`. PR-URL: #11547 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
Communicate about leaked globals via `AssertionError` rather than `console.log()`. PR-URL: #11547 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
Communicate about leaked globals via `AssertionError` rather than `console.log()`. PR-URL: #11547 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
Communicate about leaked globals via `AssertionError` rather than `console.log()`. PR-URL: #11547 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
Communicate about leaked globals via
AssertionError
rather thanconsole.log()
.Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test