In this section, we will take a look at unit tests for our existing Angular application, similar to what we have done with Backbone and Aurelia.
Angular testing
Angular test setup
When creating a project using the Angular-CLI (by issuing an ng new command), the default project setup already includes all of the boilerplate code to run unit tests using Karma, and end-to-end tests using Protractor. This default setup is a very handy feature of Angular, shortening the development effort of configuring a test environment, and giving us the ability to dive right in and write tests from the beginning of a project.
To run unit tests using Karma, we can type the following from the command line:
ng test
This command-line option will...