Jest not picking up custom type declarations except if they are in outDir #4555
Unanswered
brupxxxlgroup
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a very simple Typescript project with following structure
I have a custom declaration file under /types directory. The content looks like this.
I have updated my tsconfig.json to respect my type declaration.
I can perfectly build the project. But when i want to write tests for this JEST seems not beeing able to pick up the global.d.ts.
In my index.test.ts there is following line.
JEST now complains that the deepClone method is not on the Error.prototype even tough it should because of the custom type declaration.
When i copy the global.d.ts to the build/ directory it works. I am confused why JEST is not pickung up the global.d.ts because it's specified in the
include
section of the tsconfig.json file. Why does it need to be in the build/ folder?Beta Was this translation helpful? Give feedback.
All reactions