If the world is burning to the ground - keep calm and write a test for it
summary
Demonstrates concrete fixes for common Angular test failures: resolving a template parse error with CUSTOM_ELEMENTS_SCHEMA rather than silencing errors with NO_ERRORS_SCHEMA, remembering to call fixture.detectChanges() after setting component inputs, and stubbing HTTP calls with HttpTestingController and .flush() while asserting request URLs and response headers. Walks through TestBed setup, component creation, expectation counts, and using a done callback to mark asynchronous tests complete, with live coding and exact mock payloads.
AI-written summary · about
chapters (10)
- 0:00Introduction
- 3:36Happy birthday song
- 6:54Live coding demo
- 7:57Fixing template parse errors
- 10:58Testing card component
- 13:29Debugging failing tests
- 16:34Empty tests and HTTP mocking
- 19:22Mocking API responses
- 21:46Conditional test execution
- 22:50Summary
related talks
13mTesting Angular Components Fundamentals
19mTesting Best Practices for Angular Applications
19mModern Testing Strategies for Reactive Applications
52mAngular Testing: Do I Really Have to Do It?!
27mUnit Tests for Angular 2 Applications
59mTechniques and practices for testing Angular 2
56mTechniques and practices for testing Angular
25mAngular + Jest: Testing Titbits
