Skip to main content
Angular CLI - Code Coverage

Angular CLI - Code Coverage

Measure test coverage and interpret generated coverage reports.

Angular CLI - Code Coverage illustration

How it works

Coverage reports summarize which code ran during tests. Inspect line, branch, and function coverage alongside meaningful assertions; a high percentage alone does not show that behavior is well tested. The report location and supported flags depend on the configured test builder.

Good practice

  • Check the local Angular CLI version and run commands from the intended workspace.
  • Review angular.json targets and builders before assuming optional commands are configured.
  • Use the package manager and lockfile selected by the project.
  • Review generated files, configuration changes, and build output before committing or deploying.

Further reading: Tutorialspoint: Angular CLI - Code Coverage · Current Angular CLI reference · Workspace configuration.