summaryrefslogtreecommitdiff
path: root/test/parallel/test-common.js
diff options
context:
space:
mode:
authorcjihrig <cjihrig@gmail.com>2019-04-15 09:31:10 -0400
committerDaniel Bevenius <daniel.bevenius@gmail.com>2019-04-19 05:45:04 +0200
commit57ab3b56fcba725e1af4ed7f8a05bbdbd0b8a4d9 (patch)
tree1919658bae222ab4620541ad42c0fcbba279f823 /test/parallel/test-common.js
parent758191033f8a50d54ebc21ff8fe640666ecd3236 (diff)
downloadandroid-node-v8-57ab3b56fcba725e1af4ed7f8a05bbdbd0b8a4d9.tar.gz
android-node-v8-57ab3b56fcba725e1af4ed7f8a05bbdbd0b8a4d9.tar.bz2
android-node-v8-57ab3b56fcba725e1af4ed7f8a05bbdbd0b8a4d9.zip
test: allow leaked global check to be skipped
This simplifies the process of running tests on different versions of Node, which might have a different set of global variables. PR-URL: https://github.com/nodejs/node/pull/27239 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test/parallel/test-common.js')
-rw-r--r--test/parallel/test-common.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/parallel/test-common.js b/test/parallel/test-common.js
index 62f4eb050f..ad5680bc2f 100644
--- a/test/parallel/test-common.js
+++ b/test/parallel/test-common.js
@@ -35,6 +35,17 @@ const { execFile } = require('child_process');
}));
}
+// Test for disabling leaked global detection
+{
+ const p = fixtures.path('leakedGlobal.js');
+ execFile(process.execPath, [p], {
+ env: { ...process.env, NODE_TEST_KNOWN_GLOBALS: 0 }
+ }, common.mustCall((err, stdout, stderr) => {
+ assert.strictEqual(err, null);
+ assert.strictEqual(stderr.trim(), '');
+ }));
+}
+
// common.mustCall() tests
assert.throws(function() {
common.mustCall(function() {}, 'foo');