New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jest builder fails if the config file is written in TypeScript #5394
Comments
I ran into the same problem today. Is there an implementation planned to use a typed configuration of Jest? |
Typescript config files will soon be supported by However, I would recommend holding off on changing them just yet because our automated migrations will not work. |
Is there any update when the workspace root |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Current Behavior
As of this pull request, released in Jest 26.6.0, Jest supports writing config files in TypeScript (e.g.
jest.config.ts
). However, when I attempt to do this in an Nx project, it does not work.Pointing the
@nrwl/jest:jest
builder at a TypeScript Jest config results in an error which I think originates from TypeScript itself, complaining about how the config file is not inside a module:Interestingly, if I bypass Nx altogether and invoke Jest directly, pointing to that same config file with zero other changes, it works as expected:
$ jest --config ./apps/exchange/api/jest.config.ts # works...
So that, of course, leads me to believe that Nx is doing something incorrectly when it comes to passing the config on to Jest.
Expected Behavior
I expect that pointing Nx to my
jest.config.ts
should work.Steps to Reproduce
The general idea is pretty straightforward: Point the
@nrwl/jest:jest
builder at a Jest config which is written in TypeScript. My particular setup looks something like this:jest.config.ts
:tsconfig.spec.json
:builder definition:
Failure Logs
Environment
The text was updated successfully, but these errors were encountered: