Skip to content

Commit f193c6f

Browse files
Trottitaloacasas
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 128f812 commit f193c6f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

test/common.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -399,8 +399,7 @@ process.on('exit', function() {
399399
if (!exports.globalCheck) return;
400400
const leaked = leakedGlobals();
401401
if (leaked.length > 0) {
402-
console.error('Unknown globals: %s', leaked);
403-
fail('Unknown global found');
402+
fail(`Unexpected global(s) found: ${leaked.join(', ')}`);
404403
}
405404
});
406405

0 commit comments

Comments
 (0)