angular / angular/angular-cli

Allow passing --changed cli option to vitest

未關閉
#32,343 1 則留言 9 個 reaction 已指派 0 人 在 GitHub 檢視
angular/build:unit-test area: @angular/build feature feature: votes required
主要語言
TypeScript
星號
27k
分支
11.8k
平均合併
14 小時 23 分鐘
30 天內合併 PR
162

描述

### Command

test

### Description

The `unit-test` builder does not provide a way to use the `--changed` vitest option: https://vitest.dev/guide/cli.html#changed. This will analyze the import graph and only run tests affected by a change, which is useful for running a subset of the test suite for pull requests. This option is not available through the vitest configuration file.

### Describe the solution you'd like

Add a `changed: ` option to the `unit-test` builder options which passes `--changed ` to the vitest runner.

### Describe alternatives you've considered

I don't think there are any good workarounds. Using `@analogjs/vitest-angular` exposes vitest directly, but requires more setup and is not an "official" package.

貢獻指南

開啟貢獻指南

研究方向

從單元測試建置器選項開始,追蹤它們如何傳遞給 Vitest runner。驗證變更後的字串選項會轉送 --changed ,並確保相關的建置器測試涵蓋產生的命令。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
typescript
領域
cli, testing
Issue 類型
功能
難度
2/5
預估耗時
1-3 小時
活躍度
停滯
描述清晰度
描述清楚
新手友好度
55/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。