Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/parallel/test-cli-eval.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/parallel/test-cli-eval.js b/test/parallel/test-cli-eval.js
index 260acdb0d6f..9f781642a97 100644
--- a/test/parallel/test-cli-eval.js
+++ b/test/parallel/test-cli-eval.js
@@ -122,6 +122,17 @@ child.exec(`${nodejs} --use-strict -p process.execArgv`,
assert.strictEqual(stdout, '');
assert.strictEqual(stderr, '');
}));
+
+ // Make sure that monkey-patching process.execArgv doesn't cause child_process
+ // to incorrectly munge execArgv.
+ child.exec(
+ `${nodejs} -e "process.execArgv = ['-e', 'console.log(42)', 'thirdArg'];` +
+ `require('child_process').fork('${emptyFile}')"`,
+ common.mustCall((err, stdout, stderr) => {
+ assert.ifError(err);
+ assert.strictEqual(stdout, '42\n');
+ assert.strictEqual(stderr, '');
+ }));
}
// Regression test for https://github.com/nodejs/node/issues/8534.