DEV Community

loading...

Discussion on: Make your Angular tests 1000% faster by switching from Karma to Jest

Collapse
vbourdeix profile image
vbourdeix

Hello, I do not doubt about the benefits, but I have one question when I read at the results. If this is so fast why is it not the default test runner packaged with Angular ? Are there any hidden tradeoffs when using jest instead of Karma ?

Collapse
dylanwatsonsoftware profile image
Dylan Watson Author

Hmm definitely a fair question. I'd say that the tradeoffs I've noticed relate to the fact that you are not running in a real browser (it uses jsdom).
This means that:

  1. there is a risk that jsdom differs from your targeted browser
  2. Debugging is much less visual, though there are tools to nicely print out the html.

From my perspective, despite this, the trade-off has been worth it so far for my team.

Collapse
blacksonic profile image
Gábor Soós
  • Web Components support
  • no import/export support

although these things have been around a while, for example Web Components support in jsdom