Skip to content

Commit 12de99d

Browse files
Trottjasnell
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 76a3e49 commit 12de99d

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
@@ -402,8 +402,7 @@ process.on('exit', function() {
402402
if (!exports.globalCheck) return;
403403
const leaked = leakedGlobals();
404404
if (leaked.length > 0) {
405-
console.error('Unknown globals: %s', leaked);
406-
fail('Unknown global found');
405+
fail(`Unexpected global(s) found: ${leaked.join(', ')}`);
407406
}
408407
});
409408

0 commit comments

Comments
 (0)