Skip to content

Commit c9ad509

Browse files
committed
test: favor assertions over console logging
Communicate about leaked globals via `AssertionError` rather than `console.log()`.
1 parent ee7b7f6 commit c9ad509

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)