ng test

Runs unit tests in a project.

ng test <project> [options]

ng t <project> [options]


Takes the name of the project, as specified in the projects section of the angular.json workspace configuration file. When a project name is not supplied, it will execute for all projects.


Argument Description

The name of the project to build. Can be an application or a library.


Option Description

Override which browsers tests are run against.


Output a code coverage report.

Default: false


Globs to exclude from code coverage.


A named build target, as specified in the "configurations" section of angular.json. Each named target is accompanied by a configuration of option defaults for that target. Setting this explicitly overrides the "--prod" flag

Aliases: -c

--help= true|false|json|JSON

Shows a help message for this command in the console.

Default: false


Globs of files to include, relative to workspace or project root. There are 2 special cases:

  • when a path to directory is provided, all spec files ending "[email protected](ts|tsx)" will be included
  • when a path to a file is provided, and a matching spec file exists it will be included instead

The name of the Karma configuration file.


The name of the main entry-point file.


Enable and define the file watching poll time period in milliseconds.


The name of the polyfills file.


Do not use the real path when resolving modules. If unset then will default to true if NodeJS option --preserve-symlinks is set.


Shorthand for "--configuration=production". When true, sets the build configuration to the production target. By default, the production target is set up in the workspace configuration such that all builds make use of bundling, limited tree-shaking, and also limited dead code elimination.


Log progress to the console while building.

Default: true


Karma reporters to use. Directly passed to the karma runner.


Output sourcemaps.

Default: true


The name of the TypeScript configuration file.


Run build when files change.

--webWorkerTsConfig= webWorkerTsConfig

TypeScript configuration for Web Worker modules.

© 2010–2020 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.