Testing Best Practices for Angular Applications
summary
Shows concrete recipes and working demos: majority of checks stay as fast unit tests; use async/await for Promise-based flows, fakeAsync + tick for precise timer control (500ms debounce demo), and HttpTestingController to intercept and verify XHRs with mock responses; Angular CLI scaffolds tests and Karma runs them; Protractor requires disabling the old control flow and using async/await; future notes include AOT/LT tests and component harnesses for faster, production‑closer suites.
AI-written summary · about
chapters (26)
- 0:00Intro
- 0:18Why do we write tests?
- 1:19Testing in Angular
- 2:02Testing using Angular CLI
- 2:42Asynchronous Tests
- 3:38Demo: Delayed Echo Server
- 4:07Let's start to test
- 5:36Problem with Jasmine done
- 6:09Jasmine done fail
- 6:42async helper
- 7:13Problem: Long promise chains
- 8:35Timer
- 9:05Demo: Debounced Echo Server
- 9:34How to test that?
- 10:30Test Demo
- 11:54XHR(HttpClient)
- 12:38Demo: XHR Echo Server
- 13:01Http Testing Controller
- 14:18Summary
- 14:36More about unit test
- 15:11Async in Protractor
- 16:41Disable control flow
- 16:51Use async/await in test
- 17:24AOT Test
- 17:57Component harness
- 18:23To Summarize...
related talks
59mTechniques and practices for testing Angular 2
32mTesting Angular apps
52mAngular Testing: Do I Really Have to Do It?!
56mTechniques and practices for testing Angular
56mAngular Unit Testing from the Trenches
27mUnit Tests for Angular 2 Applications
25mAngular + Jest: Testing Titbits
13mTesting Angular Components Fundamentals
