ng test
Runs unit tests in a project.
ng test [project]
ng t [project]
Description
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.
Arguments
Argument | Description | Value Type |
---|---|---|
project |
The name of the project to build. Can be an application or a library. |
string |
Options
Option | Description | Value Type | Default Value |
---|---|---|---|
--browsers
|
Override which browsers tests are run against. Set to |
string |
|
--code-coverage
|
Output a code coverage report. |
boolean |
false |
--code-coverage-exclude
|
Globs to exclude from code coverage. |
array |
|
--configuration
|
One or more named builder configurations as a comma-separated list as specified in the "configurations" section in angular.json. The builder uses the named configurations to run the given target. For more information, see https://angular.io/guide/workspace-config#alternate-build-configurations. Aliases: -c |
string |
|
--exclude
|
Globs of files to exclude, relative to the project root. |
array |
|
--help
|
Shows a help message for this command in the console. |
boolean |
|
--include
|
Globs of files to include, relative to project root. There are 2 special cases:
|
array |
|
--inline-style-language
|
The stylesheet language to use for the application's inline component styles. |
css | less | sass | scss |
css |
--karma-config
|
The name of the Karma configuration file. |
string |
|
--main
|
The name of the main entry-point file. |
string |
|
--poll
|
Enable and define the file watching poll time period in milliseconds. |
number |
|
--polyfills
|
Polyfills to be included in the build. |
string |
|
--preserve-symlinks
|
Do not use the real path when resolving modules. If unset then will default to |
boolean |
|
--progress
|
Log progress to the console while building. |
boolean |
true |
--reporters
|
Karma reporters to use. Directly passed to the karma runner. |
array |
|
--source-map
|
Output source maps for scripts and styles. For more information, see https://angular.io/guide/workspace-config#source-map-configuration. |
boolean |
true |
--ts-config
|
The name of the TypeScript configuration file. |
string |
|
--watch
|
Run build when files change. |
boolean |
|
--web-worker-ts-config
|
TypeScript configuration for Web Worker modules. |
string |