The unit-test builder doesn't re-run test suites on changes to non-spec files
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 25/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- angular, typescript
- 领域
- build-system, testing
调研方向
从已链接的复现、其 angular.json test-storybook target 以及 npm run test-storybook 开始。修改一个未包含的 story 或其他相关文件,并观察 build 是否会重新编译而不重新运行测试。只有当对 include array 之外的文件所做的更改会再次触发测试套件时,才算完成;此 issue 已经关联了一个开放的 pull request。
由索引模型根据 Issue 内容生成。
描述
Command
test
Is this a regression?
- Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
No response
Description
Storybook has support for running component tests using Vitest. When trying to build a POC with the unit-test builder, I ran into two issues.
- Storybook can't transform the stories because the compiled code leads to file with just an
importas its contents. - Making changes to files that aren't in the
includearray doesn't trigger tests to be re-run.
I was able to work around the code import issue with a plugin that re-exports the chunks from compiled files
https://github.com/brandonroberts/angular-storybook-vitest/blob/main/vitest-storybook-base.config.ts#L16
Minimal Reproduction
https://github.com/brandonroberts/angular-storybook-vitest
- Clone and install dependencies
- Run
npm run test-storybook - Note the tests pass
- Make a change in one of the
src/stories/*.stories.tsfiles - Note the build re-compiles but the tests aren't re-run.
The test-storybook target excludes the stories files because of the import issue so they are transpiled as-is.
https://github.com/brandonroberts/angular-storybook-vitest/blob/main/angular.json#L94
Exception or Error
No exception
Your Environment
Angular v21
Anything else relevant?
No response
- 主要语言
- TypeScript
- 星标
- 27k
- 派生
- 11.8k
- 平均合并
- 16 小时 21 分钟
- 30 天内合并 PR
- 170
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
angular/angular-cli 的其他 Issue
-
area: @angular/build gemini-triaged
难度 2/5 1-3 小时 新手友好度 74/100
angular/angular-cli#33955 ·
-
area: @angular/cli gemini-triaged
难度 2/5 1-3 小时 新手友好度 72/100
angular/angular-cli#33055 · 1 条评论 · 3 个 reaction ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34131 · 已指派 1 人 ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34130 · 已指派 1 人 ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34128 · 已指派 1 人 ·
查看 angular/angular-cli 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 91/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
难度 1/5 1 小时以内 新手友好度 95/100
-
难度 2/5 1-3 小时 新手友好度 78/100
Automattic/studio#4908 ·
-
难度 2/5 1-3 小时 新手友好度 90/100
-
help wanted
难度 2/5 1-3 小时 新手友好度 72/100
hemilabs/ui-monorepo#2332 ·