ts-jest: Ts-jest is failing to locate the tsconfig when being run from inside yarn workspace (or lerna)
- Issue ts-jest is failing to locate the tsconfig when being run from inside yarn workspace (or lerna)
-
More info: ts jest is looking for tsconfig from the node_modules he is installed it and up. In yarn workspace/lerna usually it will be hoisted to the top level directory of the project. See: https://github.com/kulshekhar/ts-jest/blob/7b15180e4a6f1f7903ff1e5fcefb40dbc52a9370/src/utils.ts#L116-L129
-
jest is also get hoisted, but still it manage to find the correct package.json
- Expected behavior
ts-jest should be able to pick up the tsconfig inside it
- Link to a minimal repo that reproduces this issue
https://github.com/Bnaya/issues-repros/tree/ts-jest-and-monorepo
clone
run:
yarn install
yarn workspace foo test
or
cd packages/foo; yarn test;
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 17 (14 by maintainers)
@GantMan you are changing the working directory in your code, this is why it fails https://github.com/infinitered/solidarity/blob/master/__tests__/integration/solidarity-check/check-invalid.ts#L7
Try adding cleanup step and change the working directory back
Update: I’ve sent you a PR with the fix infinitered/solidarity/pull/88