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 摘要。