Testing Angular 2
summary
A compact, practical walkthrough of Angular 2 testing that builds a tic‑tac‑toe app and shows working examples: unit tests use TypeScript, Karma and Jasmine; dependency injection and mock providers are configured with TestBed; component tests compile templates, create a ComponentFixture, inspect native and DebugElements, and simulate clicks and keyboard events dispatched to window; asynchronous behavior uses zones so tests auto‑wait and also supports fakeAsync and tick for timeouts; Protractor E2E runs TypeScript specs with the allAngular2App flag.
AI-written summary · about
chapters (19)
- 0:00Introduction to testing
- 1:00Tooling and setup
- 2:47Karma test runner
- 4:29Jasmine framework
- 5:10Modules and dependencies
- 7:13Test bed configuration
- 10:39Component testing basics
- 12:07Tic Tac Toe example app
- 14:02Testing business logic
- 16:52Template interaction tests
- 21:29Wrapper component testing
- 26:18Introduction to zones
- 30:04Zone task management
- 32:12Async and test zones
- 36:05Fake async utility
- 37:10Testing async components
- 39:29Testing NG model
- 40:53Future testing improvements
- 42:58End to end testing
