mzgoddard / jest-webpack

Use jest with webpack.
https://www.npmjs.com/package/jest-webpack
92 stars 21 forks source link

Can't find a root directory while resolving a config file path. #35

Open fotonmoton opened 5 years ago

fotonmoton commented 5 years ago
yarn jest-webpack --config ./config/jest.config.js --rootDir .

gives:

Error: Can't find a root directory while resolving a config file path.
Provided path to resolve: ./config/jest.config.js
cwd: /home/foton/workspace/self_study/webpack/.cache/jest-webpack
    at exports.default (/home/foton/workspace/self_study/webpack/node_mod
ules/jest-config/build/resolveConfigPath.js:65:11)    at readConfig (/home/foton/workspace/self_study/webpack/node_modules/
jest-config/build/index.js:166:80)
    at getConfigs (/home/foton/workspace/self_study/webpack/node_modules/
jest-cli/build/cli/index.js:473:77)
    at Object.<anonymous> (/home/foton/workspace/self_study/webpack/node_
modules/jest-cli/build/cli/index.js:251:23)    at Generator.next (<anonymous>)
    at step (/home/foton/workspace/self_study/webpack/node_modules/jest-c
li/build/cli/index.js:206:30)
    at /home/foton/workspace/self_study/webpack/node_modules/jest-cli/bui
ld/cli/index.js:225:14
    at new Promise (<anonymous>)    at Object.<anonymous> (/home/foton/workspace/self_study/webpack/node_
modules/jest-cli/build/cli/index.js:203:12)
    at Object.runCLI (/home/foton/workspace/self_study/webpack/node_modul
es/jest-cli/build/cli/index.js:317:18)

but with yarn jest --config ./config/jest.config.js --rootDir . I don't have such error.

MiguelNiblock commented 2 years ago

this is still an issue. Although I get the same error also with your solution

tatianajiselle commented 2 years ago

also encountering this error, however it works with rootDir:

"jest --config ./test/e2e/jest-e2e.json --rootDir ."

tkssharma commented 2 months ago

any fix !!