Skip to content

Commit

Permalink
fix: retrieve right binary path (#195)
Browse files Browse the repository at this point in the history
  • Loading branch information
pmdartus committed Jan 28, 2021
1 parent d4be41b commit 2c906c7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/config.js
Expand Up @@ -37,8 +37,11 @@ const jestConfig = {

const expectedApiVersion = '50.0';

// Execute command is different on Windows.
const jestPath =
process.platform == 'win32' ? './node_modules/jest/bin/jest.js' : 'node_modules/.bin/jest';
const jestPath = (() => {
const packageJsonPath = require.resolve('jest/package.json');
const { bin } = require(packageJsonPath);

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

module.exports = { jestConfig, jestPath, expectedApiVersion };

0 comments on commit 2c906c7

Please sign in to comment.