ng test

Runs unit tests in a project.

ng test <project> [options]
      ng test <project> [options]
ng t <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.



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



Override which browsers tests are run against.


Output a code coverage report.

默认值: 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.

别名: -c


Defines the build environment.


Output in-file eval sourcemaps.

默认值: false


Shows a help message for this command in the console.

默认值: false


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.

默认值: false


When true, sets the build configuration to the production target. All builds make use of bundling and limited tree-shaking. A production build also runs limited dead code elimination.

默认值: false


Log progress to the console while building.

默认值: false


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


Output sourcemaps.

默认值: true


The name of the TypeScript configuration file.


Resolve vendor packages sourcemaps.

默认值: false


Run build when files change.

默认值: false