MCPcopy Index your code
hub / github.com/nodejs/node / test

Function test

test/parallel/test-env-var-no-warnings.js:9–21  ·  view source on GitHub ↗
(newEnv)

Source from the content-addressed store, hash-verified

7 process.emitWarning('foo');
8} else {
9 function test(newEnv) {
10 const [cmd, opts] = common.escapePOSIXShell`"${process.execPath}" "${__filename}" child`;
11
12 cp.exec(cmd, { ...opts, env: { ...opts?.env, ...newEnv } }, common.mustCall((err, stdout, stderr) => {
13 assert.strictEqual(err, null);
14 assert.strictEqual(stdout, '');
15
16 if (newEnv.NODE_NO_WARNINGS === '1')
17 assert.strictEqual(stderr, '');
18 else
19 assert.match(stderr.trim(), /Warning: foo\n/);
20 }));
21 }
22
23 test({});
24 test(process.env);

Callers 1

Calls 2

matchMethod · 0.65
execMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…