Skip to content

Commit 6e5f6e3

Browse files
TrottMylesBorins
authored andcommitted
test: favor assertions over console logging
Communicate about leaked globals via `AssertionError` rather than `console.log()`. PR-URL: #11547 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent fc41a1d commit 6e5f6e3

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

test/common.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,8 +369,7 @@ process.on('exit', function() {
369369
if (!exports.globalCheck) return;
370370
const leaked = leakedGlobals();
371371
if (leaked.length > 0) {
372-
console.error('Unknown globals: %s', leaked);
373-
fail('Unknown global found');
372+
fail(`Unexpected global(s) found: ${leaked.join(', ')}`);
374373
}
375374
});
376375

0 commit comments

Comments
 (0)