Skip to content

Commit

Permalink
fix: account for difference in behavior between npm v6 and v7 (#223) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ekashida committed Jun 18, 2021
1 parent 70853d6 commit af864c1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/utils/test-runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,14 @@ function getJestPath() {
const packageJsonPath = require.resolve('jest/package.json');

const { bin } = require(packageJsonPath);
return path.resolve(path.dirname(packageJsonPath), bin);

// Account for difference in behavior between npm v6 and v7 (#221)
let normalizedBinPath = bin;
if (typeof bin === 'object') {
normalizedBinPath = bin.jest;
}

return path.resolve(path.dirname(packageJsonPath), normalizedBinPath);
}

function getJestArgs(argv) {
Expand Down

0 comments on commit af864c1

Please sign in to comment.