The unit-test builder doesn't re-run test suites on changes to non-spec files
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 25/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Estagnada
- Stack de tecnologia
- angular, typescript
- Domínio
- build-system, testing
Direção de pesquisa
Comece com a reprodução vinculada, seu angular.json test-storybook target e npm run test-storybook. Altere uma story não incluída ou outro arquivo relevante e observe se o build é recompilado sem executar os testes novamente. Está concluído quando alterações em arquivos fora do include array acionarem a suíte de testes novamente; um pull request aberto já está vinculado a esta issue.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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
- Linguagem predominante
- TypeScript
- Estrelas
- 27k
- Forks
- 11.8k
- Merge médio
- 16h 35min
- PRs com merge (30d)
- 176
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de angular/angular-cli
-
area: @angular/build gemini-triaged
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
angular/angular-cli#33955 ·
-
area: @angular/cli gemini-triaged
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
angular/angular-cli#33055 · 1 comentário · 3 reações ·
-
unit-test: with --coverage, a setup file's hooks reach only the first spec file of each worker Abertaarea: @angular/build gemini-triaged
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 72/100
angular/angular-cli#34137 ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34131 · 1 responsável ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34130 · 1 responsável ·
Todas as issues de angular/angular-cli
Issues semelhantes
-
enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
dennys-bd/agent-hive#184 ·
-
Add: hunch Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
AbdelStark/awesome-typesafe#104 ·
-
ai-observability bug team/ai-observability
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
vicharanashala/fln#563 ·