From f18b1c91b8be9c668d6f8a4b71d9f3d81628f429 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Thu, 21 Jul 2016 12:44:01 -0400 Subject: [PATCH] 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: https://github.com/nodejs/node/pull/7826 Reviewed-By: James M Snell --- test/common.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/common.js b/test/common.js index e25088a668..5d77dc8954 100644 --- a/test/common.js +++ b/test/common.js @@ -345,6 +345,11 @@ if (global.Symbol) { knownGlobals.push(Symbol); } +function allowGlobals(...whitelist) { + knownGlobals = knownGlobals.concat(whitelist); +} +exports.allowGlobals = allowGlobals; + function leakedGlobals() { var leaked = [];