The Angular team realized the importance of testability and hence created a framework that allowed easy testing (automated) for apps built on it. The design choice of using DI construct to inject dependencies everywhere helped. This will become clear as the chapter progresses and we build a number of tests for our apps. However, before that, let's understand the types of testing that we target when building apps on this platform.
There are broadly two forms of testing that we do for a typical AngularJS app:
Unit testing: Unit testing is all about testing a component in isolation to verify the correctness of its behavior. Most of the dependencies of the component under test need to be replaced with mock implementations to make sure the unit tests do not fail due to failure in a dependent component.
End-to-end testing: This type of testing is all about executing the application like a real end user and verifying the behavior of the application. Unlike unit...