Angular Component Test Harnesses FTW
summary
Shows that replacing DOM queries and manual change detection with Angular Material component harnesses and the TestbedHarnessEnvironment.loader cuts test code dramatically, removes brittle selector logic, and auto-handles async change detection. Demonstrates the CDK testing API, harness.get / getAll / with filters, and building a custom component harness (add-comment) plus a test-host to validate the harness. Resulting tests are shorter, easier to read, and more resilient — the harness approach works and lowers maintenance.
AI-written summary · about
chapters (7)
- 0:00Angular component testing intro
- 2:12What are test harnesses
- 5:43Tests with vs without harnesses
- 10:39How harnesses work
- 18:03Custom test harnesses
- 26:17Winning with harnesses
- 27:00Q&A
related talks
22mAngular Component Test Harnesses FTW
28mTesting with Component Harnesses for the Win
24mComponentizing end-to-end tests
56mAngular Unit Testing from the Trenches
16mAngular components - unit testing
19mModern Testing Strategies for Reactive Applications
13mTesting Angular Components Fundamentals
08mAdvancing Unit Tests
