ng test
Runs unit tests in a project.
ng test <project> [options]
ng t <project> [options]
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 |
---|---|
<project> |
The name of the project to build. Can be an app or a library. |
Options
Option | Description |
---|---|
--browsers=browsers
|
Override which browsers tests are run against. |
--codeCoverage=true|false
|
Output a code coverage report. Default: |
--codeCoverageExclude
|
Globs to exclude from code coverage. |
--configuration=configuration
|
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. Aliases: -c |
--environment=environment
|
Defines the build environment. |
--evalSourceMap=true|false
|
Deprecated Output in-file eval sourcemaps. |
--help=
|
Shows a help message for this command in the console. Default: |
--karmaConfig=karmaConfig
|
The name of the Karma configuration file. |
--main=main
|
The name of the main entry-point file. |
--poll
|
Enable and define the file watching poll time period in milliseconds. |
--polyfills=polyfills
|
The name of the polyfills file. |
--preserveSymlinks=true|false
|
Do not use the real path when resolving modules. Default: |
--prod=true|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. |
--progress=true|false
|
Log progress to the console while building. |
--reporters
|
Karma reporters to use. Directly passed to the karma runner. |
--sourceMap=true|false
|
Output sourcemaps. Default: |
--tsConfig=tsConfig
|
The name of the TypeScript configuration file. |
--vendorSourceMap=true|false
|
Deprecated Resolve vendor packages sourcemaps. Default: |
--watch=true|false
|
Run build when files change. |