26 Oct 2023 10:14 AM
Right now documentation suggest fields like this in the jest.config: link
transform: {
".(css|scss|sass|less)$": "<rootDir>/style-mock.ts",
},
I suggest to add another transform:
"^.+\\.(t|j)sx?$": ["ts-jest", { isolatedModules: true }],
It might sharply decrease the execution time of jest tests.
In our case, this change reduces execution time from 20-40s* to 10s (34 test suites, 140 tests on Apple m1 chip)
* 40s only in case when jest runs tests without starting from the slowest one. Usually it takes 20-25s
Solved! Go to Solution.
27 Oct 2023 02:59 PM
I'll let the team know about this and then we'll update the docs if necessary.