Angular-cli: Angular CLI v6: Unknown option: '--browser'

Created on 18 May 2018  路  5Comments  路  Source: angular/angular-cli

Versions

Angular CLI: 6.0.3
Node: 8.11.1
OS: linux x64
Angular: 6.0.2
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.6.3
@angular-devkit/build-angular     0.6.3
@angular-devkit/build-optimizer   0.6.3
@angular-devkit/core              0.6.3
@angular-devkit/schematics        0.6.3
@angular/cli                      6.0.3
@ngtools/webpack                  6.0.3
@schematics/angular               0.6.3
@schematics/update                0.6.3
rxjs                              6.1.0
typescript                        2.7.2
webpack                           4.8.3

Repro steps

  • Install Angular 6
  • ng test --browser ChromeHeadless --code-coverage=true --single-run=true

Observed behavior

Unknown option: '--browser'

Desired behavior


Updated documentation
Fix --browser

Mention any other details that might be useful (optional)

I would like the command line to pick up a browser (e.g Chrome or ChromeHeadless) when running the tests.

Most helpful comment

Hi,

browser option has been renamed to browsers

ng t --help
usage: ng test <project> [options]
options:
  --browsers
    Override which browsers tests are run against.
  --code-coverage
    Output a code coverage report.
 [...]

Try this: ng test --browsers=ChromeHeadless --code-coverage --single-run=true

All 5 comments

Hi,

browser option has been renamed to browsers

ng t --help
usage: ng test <project> [options]
options:
  --browsers
    Override which browsers tests are run against.
  --code-coverage
    Output a code coverage report.
 [...]

Try this: ng test --browsers=ChromeHeadless --code-coverage --single-run=true

@mboughaba thank you, this works for me! Looks like --single-run is no longer available. The current workaround for it is to use --watch=false. Linking #10711

I think at one point we accepted both browsers and browser as the same thing, and that got cleaned up in v6. Sorry for the confusion.

@filipesilva Please update the doc. https://github.com/angular/angular-cli/issues/11582

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ericel picture ericel  路  3Comments

MateenKadwaikar picture MateenKadwaikar  路  3Comments

IngvarKofoed picture IngvarKofoed  路  3Comments

jmurphzyo picture jmurphzyo  路  3Comments

rajjejosefsson picture rajjejosefsson  路  3Comments