Skip to content
Closed
Changes from 1 commit
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
Prev Previous commit
test: resolve eslint errors in test-npm-install.js
  • Loading branch information
putxe committed Nov 12, 2019
commit c7efb41b79d073c9ff08f8bc77b7c554dec7b7ef
10 changes: 5 additions & 5 deletions test/parallel/test-npm-install.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ const pkgPath = path.join(installDir, 'package.json');

fs.writeFileSync(pkgPath, pkgContent);

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,
const env = { ...process.env,
Copy link
Copy Markdown
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`, {
Expand Down