Let's learn how to speed up our Angular Jest tests by more than 100% by switching to Jest ESM (a notoriously problematic migration) and how to solve all the troublesome issues that tend to pop up along the way!
TLDR;
- Jest is fast until it isn't therefore we have to bother with ESM
- Basic Jest ESM setup is pretty straight forward
- There is an ideal Jest ESM scenario where it would just work if libraries implemented ESM correctly
- In real life Jest ESM breaks because most libs ship incorrect ESM
- The moduleNameMapper and transformIgnorePatterns are the main tools that will help is to fix all the Jest ESM problems
- We're going to progress through list of common problems and their solutions (please share yours to make it more complete in the comments)
Top comments (0)