You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Angular 10.0.13指定defaultProject时如何运行所有项目测试?

Answer

Great question! Let's break this down into two key parts: how to run all tests when defaultProject is set, and whether this is a bug or intentional change.

Workaround to run all tests with defaultProject configured

If you need to execute tests for every project in your Angular 10.0.13 workspace while defaultProject is defined, use the explicit --all flag with the test command:

ng test --all

This flag overrides the default project behavior and forces the CLI to run tests across every project in your workspace. You could also list all project names directly (e.g., ng test auth-app dashboard-app shared-lib), but --all is far more efficient for larger workspaces.

Is this a bug or a breaking change?

This is a confirmed bug in Angular 10.0.13, not an intentional breaking change.

The official Angular CLI documentation clearly states that running ng test without specifying a project should execute tests for all projects. This behavior worked reliably in Angular 9.x, but a regression was introduced in the 10.0.x release line that caused the CLI to only run tests for the defaultProject when no project name was provided.

Good news: This issue was fixed in later minor versions of Angular 10 (like 10.1.x and newer). If you upgrade your workspace to the latest available minor version of Angular 10, the original behavior of ng test (running all tests when no project is specified) will be restored, even with defaultProject set in angular.json.

内容的提问来源于stack exchange,提问作者TmTron

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.09 08:07:45