Angular CLI 6 未知选项:'--singleRun' [英] Angular CLI 6 Unknown option: '--singleRun'

查看:27
本文介绍了Angular CLI 6 未知选项:'--singleRun'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我想执行我的测试时,我曾经激活了 --single-run 选项,但升级到 Angular 6 后它不再被识别.

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

<块引用>

未知选项:'--singleRun'

Angular CLI 6 中 --single-run 的等效选项是什么?

解决方案

在旧版本的 angular-cli 中,您曾经可以同时使用 --singleRun--watch=false 同样的事情.现在他们删除了 --singleRun.

你仍然可以使用 ng test --watch=false

Angular cli 1.x 文档

<块引用>

测试将在通过 Karma 执行构建后执行,它会自动监视您的文件的更改.您可以通过 --watch=false 或 --single-run 运行一次测试.

Angular cli 6.x 文档

<块引用>

测试将在通过 Karma 执行构建后执行,它会自动监视您的文件的更改.您可以通过 --watch=false 运行一次测试.

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 ?

解决方案

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.

这篇关于Angular CLI 6 未知选项:'--singleRun'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆