Skip to content

Commit 53f2848

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 d622b67 commit 53f2848

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
@@ -360,8 +360,7 @@ process.on('exit', function() {
360360
if (!exports.globalCheck) return;
361361
var leaked = leakedGlobals();
362362
if (leaked.length > 0) {
363-
console.error('Unknown globals: %s', leaked);
364-
assert.ok(false, 'Unknown global found');
363+
exports.fail(`Unexpected global(s) found: ${leaked.join(', ')}`);
365364
}
366365
});
367366

0 commit comments

Comments
 (0)