Import tsconfig.json in configuration without resolveJsonModule option enabled #3932
Unanswered
carlocorradini
asked this question in
Q&A
Replies: 1 comment
-
|
For anyone who stumbles over this, here is a workaround: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have my jest configuration with
.tsextension:jest.config.ts.I'm using
pathsToModuleNameMapperfunction to transform theTypeScriptpaths during testing, and I'm importing my tsconfig withimport tsconfig from "./tsconfig.json".My main
tsconfig.jsondoes not haveresolveJsonModuleenabled. Therefore, when callingjestit fails:Cannot find module './tsconfig.json'. Consider using '--resolveJsonModule' to import module with '.json' extension.How can I use
jestwith mytsconfigwithout explicitly enablingresolveJsonModulein my maintsconfig? Or, in other words, can I passresolveJsonModule: truewhen callingjest?Thanks!
Beta Was this translation helpful? Give feedback.
All reactions