Skip to main content
Angular CLI - ng test

Angular CLI - ng test

Run unit tests using the test builder configured for the project.

Angular CLI - ng test illustration

How it works

ng test runs the project test target using its configured builder and test framework. Test setup varies by Angular version and workspace choices. Use watch mode for development and a CI-appropriate noninteractive mode where supported.

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 - ng test · Current Angular CLI reference · Workspace configuration.