Unit test execution

Angular CLI uses the Jasmine unit testing library to define unit tests and the Karma test runner to execute them. Best of it all, these testing tools are configured to be run out of the box. You may execute the unit tests with the following command:

$ npm test

The tests will be run by the Karma test runner in a new Chrome browser window. The main benefit of Karma is that it brings live-reloading capabilities similar to what Angular CLI achieves with WebPack when developing your application. You should observe the last message on the Terminal to be Executed 5 of 5 (5 FAILED) ERROR. This is normal, because we haven't been paying attention to the tests at all, so let's fix them all.

Karma Runner showing Jasmine Unit Test Results

Keep the Karma Runner window open side-by-side with VS Code so that you can instantly see the results of your changes.