Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions test/parallel/test-npm-install.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ const pkgPath = path.join(installDir, 'package.json');

fs.writeFileSync(pkgPath, pkgContent);

const env = Object.assign({}, process.env, {
PATH: path.dirname(process.execPath),
NPM_CONFIG_PREFIX: path.join(npmSandbox, 'npm-prefix'),
NPM_CONFIG_TMP: path.join(npmSandbox, 'npm-tmp'),
HOME: homeDir,
});
const env = { ...process.env,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can be made more readable as follows:

const env = {
  ...process.env,
  PATH: path.dirname(process.execPath),
  NPM_CONFIG_PREFIX: path.join(npmSandbox, 'npm-prefix'),
  NPM_CONFIG_TMP: path.join(npmSandbox, 'npm-tmp'),
  HOME: homeDir
};

PATH: path.dirname(process.execPath),
NPM_CONFIG_PREFIX: path.join(npmSandbox, 'npm-prefix'),
NPM_CONFIG_TMP: path.join(npmSandbox, 'npm-tmp'),
HOME: homeDir,
};

exec(`${process.execPath} ${npmPath} install`, {
cwd: installDir,
Expand Down