use ts-jest and ts-jest/presets/default-esm in the same monorepo
its-dibo opened this issue · comments
Version
29.0.3
Steps to reproduce
I have a monorepo that includes some commonjs and esm projects
I configured the root jest.config.ts to use ts-jest
as a preset and added projects
property, so each project has its own jest.config.ts file
in esm projects I override the value of preset to 'ts-jest/presets/default-esm', but I got errors when the test encounters an esm feature.
it works when I set preset in the root config file to ts-jest
but this makes commonjs projects have issues
Expected behavior
.
Actual behavior
.
Debug log
.
Additional context
No response
Environment
.
If you are using projects
property, the root level preset
will be ignored. This is the default behavior of Jest config. For monorepo, it's better that you specify preset
per project config instead of root level.
Note that this doesn't belong to ts-jest
scope because this repo is a transformer. Your issue is related to Jest configuration.
the root level
preset
will be ignored
this is the expected behavior, but the actual behavior is that esm is not being used. I am going to prepare a minimal reproduction to showcase this issue
The preset is used or not it’s up to Jest, we can’t interfere that process. Please use Discussions section of GitHub for help or you can ask in Jest Discord