I'm trying to use Jest to run some TypeScript tests, but it's slow, taking 10s to run the following tests:
import "jest"
test("good", () => {
expect(2).toBe(2)
})
test("bad", () => {
expect(2).toBe(3)
})
I've run it in --watch mode as well and it has the same 10s run when the file changes.
I am using TypeScript in a large project. While there are no modules being imported in the sample file, the tsconfig.json has paths to the whole project.
How do I determine why Jest is going so slowly, so that I can figure out how to speed it up?
If I create a .js file with the same tests, and remove the import line, it is fast. This indicates probably something with the TypeScript aspect.