Advancing Unit Tests
summary
Tests for OnPush change detection show failing behavior until the test harness calls fixture.detectChanges and reveals change detection runs only once in the initial setup. The team uses TestBed.overrideComponent to swap OnPush for Default during early experiments, then adopts a CMA-style test structure that triggers change detection explicitly and asserts the template renders the expected id. The workaround is temporary; the restructured tests reliably pass.
AI-written summary · about
chapters (6)
- 0:00Start
- 0:41Courtney Christian
- 1:54What is it?
- 2:39Why Don't More People Do It?
- 3:17How it's done
- 6:59Example
related talks
28mAngular Component Test Harnesses FTW
17mNavigating Angular's Evolution for Peak Performance!
28mTesting with Component Harnesses for the Win
22mAngular Component Test Harnesses FTW
19mModern Testing Strategies for Reactive Applications
49mPragmatic Testing
26mTesting the Tricky Stuff
27mUnit Tests for Angular 2 Applications
