The unit-test builder doesn't re-run test suites on changes to non-spec files
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- angular, typescript
- Área
- build-system, testing
Línea de trabajo
Empieza con la reproducción enlazada, su angular.json test-storybook target y npm run test-storybook. Cambia una story no incluida u otro archivo relevante y observa si el build vuelve a compilarse sin volver a ejecutar los tests. Se considera terminado cuando los cambios en archivos fuera del include array vuelven a activar la suite de tests; ya hay un pull request abierto enlazado a este issue.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- TypeScript
- Estrellas
- 27k
- Forks
- 11.8k
- Merge medio
- 16 h 21 min
- PR fusionados (30 d)
- 170
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de angular/angular-cli
-
area: @angular/build gemini-triaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
angular/angular-cli#34129 ·
-
Support aube as package manager Abiertoarea: @angular/cli gemini-triaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
angular/angular-cli#34057 ·
-
Can't use an array of hostnames in --allowedHosts cli parameter in @angular/build:dev-server Abiertoarea: @angular/build gemini-triaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
angular/angular-cli#33955 ·
-
area: @angular/cli gemini-triaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
angular/angular-cli#33055 · 1 comentario · 3 reacciones ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34131 · 1 asignado ·