DEV Community

kreuzerk
kreuzerk

Posted on • Originally published at blog.angularindepth.com on

1

Improved debugging of Angular component tests in Jest

with @angular-extensions/pretty-html-log

Good tests are the backbone of every application. They are crucial to the success of our project. Therefore it’s no surprise that Angular is designed with testing in mind and provides us with a lot of testing utils.

By default, the Angular CLI generates a project with Karma as a test runner and Jasmine as a testing framework. However, today, many people move away from this default stack and start to use Jest.

There are various motivations to do so. Most commonly, it’s due to better performance and stability. Jest is way faster than Karma. It can run tests in parallel and doesn’t have to start a browser because it uses a JavaScript implementation of a DOM called jsdom.

While jsdom is fast, it also impedes debugging.

Find out how to improve debugging your component tests

Image of Datadog

The Essential Toolkit for Front-end Developers

Take a user-centric approach to front-end monitoring that evolves alongside increasingly complex frameworks and single-page applications.

Get The Kit

Top comments (0)

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

👋 Kindness is contagious

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

Okay