Test your components with Angular Material’s component harnesses!
How and why to use Angular materials component harness to write reliable, stable and readable component tests
Simultaneously to the Angular 9 release, a new version of the Material component library was released. This release includes an absolute highlight feature, Angular Material test harnesses.
Testing in Angular
Good tests are the backbone of every application. They ensure that our app runs the way we expect it. Moreover, a robust test suite facilitates refactorings. Reliable tests allow us to change things under the hood without affecting the behavior.
In Angular, we distinguish between different types of tests; unit tests, component tests (integration tests) and end to end tests.
Unit tests are the most straightforward tests to write; they simply test functions of our TypeScript code. Component- and End to end tests on the other side are a little bit harder. They don’t only test the TypeScript code, but also the template, which may include third-party libraries such as…