Search⌘ K
AI Features

Running Tests Using the Angular CLI

Explore how to run tests in Angular applications using the Angular CLI. Learn to start tests with the ng test command, interpret test outputs, and utilize key arguments like --codeCoverage and --watch to improve testing efficiency and coverage. This lesson helps you build confidence in maintaining app reliability through effective testing practices.

Command to run tests

To run the tests within an Angular application, we can simply use a single command to the Angular CLI:

ng test

This will begin the process of starting Karma, launching the browser, and finding and running all the test specs we have in our code base. Then, within the same Terminal window, we will see the outcome of the tests and if they ...