DEV Community

Tomas Trajan 🇨🇭 for Angular

Posted on • Originally published at angularexperts.io on

3

Jest ESM — Total Guide To More Than 100% Faster Testing For Angular⚡

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)

Continue reading on AngularExperts.io »

AWS Q Developer image

Your AI Code Assistant

Automate your code reviews. Catch bugs before your coworkers. Fix security issues in your code. Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Get started free in your IDE

Top comments (0)

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay