Skip to content

test: allow leaked global check to be skipped - #27239

Closed
cjihrig wants to merge 1 commit into
nodejs:masterfrom
cjihrig:globals
Closed

test: allow leaked global check to be skipped#27239
cjihrig wants to merge 1 commit into
nodejs:masterfrom
cjihrig:globals

Conversation

@cjihrig

@cjihrig cjihrig commented Apr 15, 2019

Copy link
Copy Markdown
Contributor

This simplifies the process of running tests on different versions of Node, which might have a different set of global variables.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
This simplifies the process of running tests on different
versions of Node, which might have a different set of
global variables.
@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to Node.js core tests and test infrastructure. label Apr 15, 2019
@cjihrig

cjihrig commented Apr 15, 2019

Copy link
Copy Markdown
Contributor Author

cc: @Trott

@Trott Trott left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Nit: Probably worth adding a note to test/common/README.md about it?

@BridgeAR BridgeAR added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Apr 15, 2019
@danbev

danbev commented Apr 19, 2019

Copy link
Copy Markdown
Contributor

Landed in 57ab3b5.

Comment thread test/common/index.js
if (process.env.NODE_TEST_KNOWN_GLOBALS !== '0') {
if (process.env.NODE_TEST_KNOWN_GLOBALS) {
const knownFromEnv = process.env.NODE_TEST_KNOWN_GLOBALS.split(',');
allowGlobals(...knownFromEnv);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be something like:

allowGlobals(...knownFromEnv.map((name) => globalThis[name]));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. test Issues and PRs related to Node.js core tests and test infrastructure.

9 participants