ngx-testing-library is an Angular adapter around dom-testing-library, inspired by Kent C. Dodds' react-testing-library philosophy of testing UI components without testing implementation details. It provides a single createComponent method that sets up the Angular TestBed and exposes dom-testing-library query functions and fireEvent utilities. The goal is to write tests that mirror how users interact with the app, making tests more resilient to implementation changes. Compatible with Jasmine, Jest, or any test runner.

3m read timeFrom timdeschryver.dev
Post cover image
Table of contents
A bit of backgrounddom-testing-libraryngx-testing-libraryNot to miss
5 Impressions