Reputation: 1031
Inside my tsconfig.json
, I have these exclusions.
"exclude": [
"**/node_modules",
"**/*.spec.ts",
"**/*.spec.tsx",
"**/*.test.ts",
"**/*.test.tsx"
]
Which is needed so the editor doesn't squawk at jest methods. However I need the following rule for absolute import
"baseUrl": "."
How can I solve this issue?
Upvotes: 1
Views: 187
Reputation: 576
If the only issue you have with types is jest methods, you should definitely have a look at ts-jest. It will allow you to create jest config, that will make jest run typescript as code preprocessor and will strictly type jest methods.
Opting out of type checking for tests seems tempting at first, but I personally found many bugs in my function calls or even application code when I stopped excluding them.
Upvotes: 1