April 2014
Intermediate to advanced
688 pages
17h 48m
English
CHAPTER 25
![]()
Unit Testing
In this chapter, I describe the facilities that AngularJS provides for unit testing and, in particular, the services that make it easy to isolate a piece of code from the rest of the AngularJS framework to enable thorough and consistent testing. Table 25-1 summarizes this chapter.
Table 25-1. Chapter Summary
Problem |
Solution |
Listing |
|---|---|---|
Write a basic Jasmine unit test. |
Use the Jasmine describe, beforeEach, it, and expect functions. |
1–4 |
Prepare an AngularJS test. |
Use the angular.mock.module method to load the module you want to test, and use the angular.mock.inject method to resolve dependencies. |
5 |
Mock HTTP ... |
Read now
Unlock full access