Skip to content

Commit f18b1c9

Browse files
committed
test: allow globals to be whitelisted
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>
1 parent 99f45b2 commit f18b1c9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/common.js

+5
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,11 @@ if (global.Symbol) {
345345
knownGlobals.push(Symbol);
346346
}
347347

348+
function allowGlobals(...whitelist) {
349+
knownGlobals = knownGlobals.concat(whitelist);
350+
}
351+
exports.allowGlobals = allowGlobals;
352+
348353
function leakedGlobals() {
349354
var leaked = [];
350355

0 commit comments

Comments
 (0)