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 <[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]>
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)