{ "id": "cli/test", "title": "ng test", "contents": "\n
\n
\n mode_edit\n code\n
\n \n\n\n
\n \n CLI\n
\n\n \n
\n

ng testlink

\n
\n\n\n \n\n
\n \n

Runs unit tests in a project.

\n\n \nng test <project> [options]\n\nng t <project> [options]\n\n\n\n \n

\n \n Description\n

\n

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

\n\n \n\n \n\n

Arguments

\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
ArgumentDescriptionValue Type
<project>\n

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

\n\n \n
string
\n\n\n \n\n

Options

\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
OptionDescriptionValue TypeDefault Value
\n --browsers\n \n \n

Override which browsers tests are run against.

\n\n \n
string
\n --code-coverage\n \n \n

Output a code coverage report.

\n\n \n
booleanfalse
\n --code-coverage-exclude\n \n \n

Globs to exclude from code coverage.

\n\n \n
array
\n --configuration\n \n \n

One or more named builder configurations as a comma-separated list as specified in the \"configurations\" section of angular.json.\nThe builder uses the named configurations to run the given target.\nFor more information, see https://angular.io/guide/workspace-config#alternate-build-configurations.\nSetting this explicitly overrides the \"--prod\" flag.

\n\n

Aliases: -c

\n
string
\n --help\n \n \n

Shows a help message for this command in the console.

\n\n \n
true|false|json|JSONfalse
\n --include\n \n \n

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

\n
    \n
  • when a path to directory is provided, all spec files ending \".spec.@(ts|tsx)\" will be included
  • \n
  • when a path to a file is provided, and a matching spec file exists it will be included instead
  • \n
\n\n \n
array
\n --karma-config\n \n \n

The name of the Karma configuration file.

\n\n \n
string
\n --main\n \n \n

The name of the main entry-point file.

\n\n \n
string
\n --poll\n \n \n

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

\n\n \n
number
\n --polyfills\n \n \n

The name of the polyfills file.

\n\n \n
string
\n --preserve-symlinks\n \n \n

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

\n\n \n
boolean
\n --prod\n \n \n \n

Deprecated: Use --configuration production instead.

\n\n \n \n

Shorthand for \"--configuration=production\".\nSet the build configuration to the production target.\nBy 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.

\n\n \n
boolean
\n --progress\n \n \n

Log progress to the console while building.

\n\n \n
booleantrue
\n --reporters\n \n \n

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

\n\n \n
array
\n --source-map\n \n \n

Output source maps for scripts and styles. For more information, see https://angular.io/guide/workspace-config#source-map-configuration.

\n\n \n
booleantrue
\n --ts-config\n \n \n

The name of the TypeScript configuration file.

\n\n \n
string
\n --watch\n \n \n

Run build when files change.

\n\n \n
boolean
\n --web-worker-ts-config\n \n \n

TypeScript configuration for Web Worker modules.

\n\n \n
string
\n\n\n \n
\n
\n\n\n" }