Run Unit Tests Using Angular CLI

Let's see how we can use the Angular CLI to run unit tests.

Testing in Angular

Unit Tests are an important part of modern web application development. Angular creates tests for every component or service automatically when you use the ng generate command (though you can pass an argument to the generate command to not create a test). If you look at the codebase of our Angular application, you’ll see many examples of these files ending in spec.ts. These are the test files that the Angular CLI has created for us.

Get hands-on with 1400+ tech skills courses.