Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3b94e31

Browse filesBrowse files
author
Myles Borins
committed
test: robust handling of env for npm-test-install
Currently we are overwriting the entire env object of the child-process spawned in `npm-test-install`. This commit alternatively clones the `process.env` object and modifies it with the neccessary changes before passing it the the spawned process. Fixes: #6736 PR-URL: #6797 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 6a76485 commit 3b94e31
Copy full SHA for 3b94e31

File tree

Expand file treeCollapse file tree

1 file changed

+4
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-3
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-npm-install.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-npm-install.js
+4-3Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,12 @@ const pkgPath = path.join(common.tmpDir, 'package.json');
3232

3333
fs.writeFileSync(pkgPath, pkgContent);
3434

35+
const env = Object.create(process.env);
36+
env['PATH'] = path.dirname(process.execPath);
37+
3538
const proc = spawn(process.execPath, args, {
3639
cwd: common.tmpDir,
37-
env: {
38-
PATH: path.dirname(process.execPath)
39-
}
40+
env: env
4041
});
4142

4243
function handleExit(code, signalCode) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.