Test Driven Development with AngularJS
summary
Test driven development for AngularJS demonstrates concrete steps: start with a failing spec, write minimal code, iterate to grow behavior. Uses red-green-refactor, runs tests with Karma + Jasmine (auto-watch, Chrome), mocks with Canon, and shows controller vs service test patterns, scope injection, and provider-based service mocking. Example is a shopping cart exercised via incremental specs; a claimed migration from a 100,000-line Backbone app cuts source to about 30% of the original lines. Code lives as the NG Shopper app with step-by-step commits.
AI-written summary · about
chapters (15)
- 0:00Start
- 3:14The Javascript Jabber Podcast
- 4:12Benefits of Test-Driven Development
- 4:23Benefits of Test-Driven Development Requirements in Code
- 11:26The Tdd Process
- 12:24Carbon Configuration
- 17:35Root Scope
- 18:13The Flow of the Tests
- 20:08Controller Constructor
- 25:06Create a Mock Cart
- 33:36Cart Tests
- 36:39Code Up a Test
- 37:37Inject Function
- 44:21Mock Http
- 47:50Final Questions
related talks
52mAngular Testing: Do I Really Have to Do It?!
56mAngular Unit Testing from the Trenches
59mTechniques and practices for testing Angular 2
56mTechniques and practices for testing Angular
43mAngular TDD Like You Never Seen Before
42mTest-Driven Development in Javascript
19mTesting Best Practices for Angular Applications
32mTesting Angular apps
