Skip to content

Commit

Permalink
test: allow globals to be whitelisted
Browse files Browse the repository at this point in the history
This commit adds a function to test/common.js that allows
additional global variables to be whitelisted in a test.

PR-URL: #7826
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
cjihrig committed Aug 10, 2016
1 parent e561895 commit 9735acc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,11 @@ if (global.Symbol) {
knownGlobals.push(Symbol);
}

function allowGlobals(...whitelist) {
knownGlobals = knownGlobals.concat(whitelist);
}
exports.allowGlobals = allowGlobals;

function leakedGlobals() {
var leaked = [];

Expand Down

0 comments on commit 9735acc

Please sign in to comment.