A simple monorepo with the following config:
// package/ui/jest.config.js
{
globals: {
"ts-jest": {
babelConfig: {
rootMode: "upward"
}
},
preset: "ts-jest",
transform: {
"^.+\\.jsx?$": ["babel-jest", { rootMode: "upward" }]
}
}
When I run yarn test it works as expected. When I run yarn lerna run test, ts-jest fails to load babel configs. If I use babel-jest instead of ts-jest, it works fine. The only way to make it work is to manually pass the entire babel config to globals[ts-jest].babelConfig.
Maybe something like globals[ts-jest].babelConfig.babelrc: true would be nice in such case to allow loading configs. It didn't worked with globals[ts-jest].babelConfig: true
Minimal repo
https://github.com/arvigeus/monotest
A simple monorepo with the following config:
When I run
yarn testit works as expected. When I runyarn lerna run test,ts-jestfails to load babel configs. If I usebabel-jestinstead ofts-jest, it works fine. The only way to make it work is to manually pass the entire babel config toglobals[ts-jest].babelConfig.Maybe something like
globals[ts-jest].babelConfig.babelrc: truewould be nice in such case to allow loading configs. It didn't worked withglobals[ts-jest].babelConfig: trueMinimal repo
https://github.com/arvigeus/monotest