From the course: Learning the Angular CLI

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Test run options

Test run options - Angular Tutorial

From the course: Learning the Angular CLI

Start my 1-month free trial

Test run options

- [Instructor] Let's take a look now at the different options available to us when running our tests. Currently, our tests are in watch mode. If you prefer not to do that, we can use a flag. Let me go ahead and kill this process here and run ng test --no-watch. In this case, our test will only run once and then exit. In continuous integration environments, this will be needed. I would also recommend to generate code coverage reports when running your tests. To do so, you can use a new flag that's called --code-coverage. What this will do, is generate code coverage reports using Istanbul. When that is done, you'll see that we have a new coverage folder here. In particular, we're interested in viewing index.html. Go ahead and open that up in your browser. What you see here, is a coverage report indicating the files and lines that have been tested through your spec files. Green means that we have tested the underlying…

Contents