Angular CLI 6 Unknown option: '--singleRun'
Asked Answered
S

3

39

When I want to execute my tests, I used to have the option --single-run activated, but after upgrading to Angular 6 it is not recognized anymore.

> ng test --source-map=false --single-run --no-progress --browsers=ChromeNoSandbox

Unknown option: '--singleRun'

What is the equivalent option in Angular CLI 6 for --single-run ?

Spoiler answered 12/6, 2018 at 12:11 Comment(1)
Use ng test --watch More information here github.com/angular/angular-cli/issues/10711Subtorrid
M
67

With older versions of angular-cli, you used to be able to use both --singleRun and --watch=false for the same thing. Now they removed --singleRun.

You can still use ng test --watch=false

Angular cli 1.x docs

Tests will execute after a build is executed via Karma, and it will automatically watch your files for changes. You can run tests a single time via --watch=false or --single-run.

Angular cli 6.x docs

Tests will execute after a build is executed via Karma, and it will automatically watch your files for changes. You can run tests a single time via --watch=false.

Mcdonnell answered 12/6, 2018 at 12:17 Comment(3)
I'd like to point out that for @angular/cli version 7.0.4 this doesn't work.Picky
To follow on from my previous comment this appears to be an open issue: github.com/angular/angular-cli/issues/12816Picky
This question is about Angular 6 and not Angular 7.Spoiler
K
6

You should use ng test

ng test --watch=false
Kendallkendell answered 12/6, 2018 at 12:16 Comment(0)
I
0

Please refer to this issue and comment

https://github.com/angular/angular-cli/issues/10711#issuecomment-387704999

Starting from Angular v6, you don't need to specify --single-run

Implacable answered 12/6, 2018 at 12:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.