Skip to content

Commit

Permalink
test: favor assertions over console logging
Browse files Browse the repository at this point in the history
Communicate about leaked globals via `AssertionError` rather than
`console.log()`.
  • Loading branch information
Trott committed Feb 26, 2017
1 parent ee7b7f6 commit c9ad509
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions test/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,7 @@ process.on('exit', function() {
if (!exports.globalCheck) return;
const leaked = leakedGlobals();
if (leaked.length > 0) {
console.error('Unknown globals: %s', leaked);
fail('Unknown global found');
fail(`Unexpected global(s) found: ${leaked.join(', ')}`);
}
});

Expand Down

0 comments on commit c9ad509

Please sign in to comment.