Techniques and practices for testing Angular 2
summary
Shows concrete recipes for Angular testing using Karma + Jasmine for unit tests, Protractor for end-to-end, and optional Wallaby in the IDE; demos use the Angular CLI and a small Chuck Norris app that successfully passes tests. Covers fakes vs Jasmine spies (verify calls and args), using TestBed to get a TestBed fixture/debugElement and query the DOM, and two async strategies: fakeAsync/tick (simulates a two‑second delay) and async/whenStable (returns a promise). All examples run live and the assertions pass.
AI-written summary · about
chapters (24)
- 0:00Start
- 0:13Adam Stephens
- 1:07Testing with Angular 2
- 4:28Why Are People Writing Tests
- 9:45Angular Cli Is Not a Testing Tool
- 10:38Jasmine
- 15:56Faking Dependencies
- 17:08Jasmine Spies
- 21:06Fake Joke Service
- 22:45Jasmine Spy
- 24:56Benefits of Spying
- 25:22Testbed
- 25:42Types of Tests
- 25:58Shallow Test
- 29:25Code Demo
- 29:48Configure a Testing Module
- 32:37Dependency Injection
- 37:30Test Asynchronous Code
- 37:53Jasmine Done Callbacks
- 39:57Fake Async
- 46:27End-to-End Tests
- 52:30Run the Test
- 57:59Testing Docs
- 58:42Summary
related talks
56mTechniques and practices for testing Angular
52mAngular Testing: Do I Really Have to Do It?!
19mTesting Best Practices for Angular Applications
56mAngular Unit Testing from the Trenches
32mTesting Angular apps
27mUnit Tests for Angular 2 Applications
25mAngular + Jest: Testing Titbits
13mTesting Angular Components Fundamentals
