You can generate a coverage report for your unit tests by adding
--code-coverage switch to the
ng test --single-run --code-coverage
Under the hood the
ng tool performs the following actions:
- compile the project with webpack, including TypeScript transpilation with source maps
- use Karma runner and Jasmine to execute unit tests
- generate HTML report within
After testing finishes you can either open
coverage/index.html with your favorite browser.
The command above should serve your coverage report and automatically launches default browser with the main page.
src/app and then
app.component.ts to see TypeScript coverage: