test: pass env through to child processes
Add a helper function to provide an easy way to modify the environment passed to child processes.
Fixes: #14823 (closed) Refs: https://github.com/nodejs/node/pull/14822
The function itself is trivial, the main benefit to having it is that it gives an easy way to pass modified environments to child processes. There are a bunch of tests that don't pass the environment through to child processes, and the tests that do use a variety of methods. So ideally by having a common
function we can standardise on this way of doing things.
An alternative would be to just replace all of these with Object.assign({}, process.env, additionalEnv)
.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
documentation is changed or added -
commit message follows commit guidelines
Affected core subsystem(s)
test