summaryrefslogtreecommitdiff
path: root/test/parallel/test-cli-node-options.js
diff options
context:
space:
mode:
authorGibson Fahnestock <gibfahn@gmail.com>2017-08-15 19:14:54 +0100
committerRuben Bridgewater <ruben@bridgewater.de>2017-09-03 17:28:50 -0300
commit180f86507d496b11aa35b2df4594629a92cce329 (patch)
tree96993491524bbba0fb642f9c3c47f89b2fedf3b0 /test/parallel/test-cli-node-options.js
parented084a035c1f657284f3eee7f7a583a42e8b35f1 (diff)
downloadandroid-node-v8-180f86507d496b11aa35b2df4594629a92cce329.tar.gz
android-node-v8-180f86507d496b11aa35b2df4594629a92cce329.tar.bz2
android-node-v8-180f86507d496b11aa35b2df4594629a92cce329.zip
test: remove envPlus, use Object.assign everywhere
PR-URL: https://github.com/nodejs/node/pull/14845 Fixes: https://github.com/nodejs/node/issues/14823 Refs: https://github.com/nodejs/node/pull/14822 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'test/parallel/test-cli-node-options.js')
-rw-r--r--test/parallel/test-cli-node-options.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/parallel/test-cli-node-options.js b/test/parallel/test-cli-node-options.js
index eb31e280c3..f52497e808 100644
--- a/test/parallel/test-cli-node-options.js
+++ b/test/parallel/test-cli-node-options.js
@@ -29,7 +29,8 @@ disallow('--');
disallow('--no_warnings'); // Node options don't allow '_' instead of '-'.
function disallow(opt) {
- const options = { env: { NODE_OPTIONS: opt } };
+ const options = { env: Object.assign({}, process.env,
+ { NODE_OPTIONS: opt }) };
exec(process.execPath, options, common.mustCall(function(err) {
const message = err.message.split(/\r?\n/)[1];
const expect = `${process.execPath}: ${opt} is not allowed in NODE_OPTIONS`;
@@ -71,7 +72,7 @@ function expect(opt, want) {
const printB = require.resolve('../fixtures/printB.js');
const argv = [printB];
const opts = {
- env: { NODE_OPTIONS: opt },
+ env: Object.assign({}, process.env, { NODE_OPTIONS: opt }),
maxBuffer: 1000000000,
};
exec(process.execPath, argv, opts, common.mustCall(function(err, stdout) {