1

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?

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.