DEV Community

Discussion on: Why Jest is not for me

Collapse
 
lexlohr profile image
Alex Lohr

Mocking the DOM has its drawbacks, but also its advantages: you're typically much faster than starting a full-blown browser; it doesn't need a graphical interface to run on the CI/CD infrastructure (e.g. wayland or X if running linux).

However, that's not the only way to run jest; it supports different environments, e.g. webdriver (using selenium to run tests directly in the browser); jsdom is only the default for convenience reasons. The lack of ESM support is a definite drawback, though.

Uvu is really great, but lacks a junit output. If you need that, you may want to try tape.

Jest is neither bad nor deceiving, just weakly documented, opinionated and somewhat overengineered. I only recently wrote a post about testing Solid.js code in jest and the slow test runs in jest made me follow up with another article on how to test it with uvu and tape.