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
-
I have my jest configuration with
.ts
extension:jest.config.ts
.I'm using
pathsToModuleNameMapper
function to transform theTypeScript
paths during testing, and I'm importing my tsconfig withimport tsconfig from "./tsconfig.json"
.My main
tsconfig.json
does not haveresolveJsonModule
enabled. Therefore, when callingjest
it fails:Cannot find module './tsconfig.json'. Consider using '--resolveJsonModule' to import module with '.json' extension.
How can I use
jest
with mytsconfig
without explicitly enablingresolveJsonModule
in my maintsconfig
? Or, in other words, can I passresolveJsonModule: true
when callingjest
?Thanks!
Beta Was this translation helpful? Give feedback.
All reactions