The unit-test builder doesn't re-run test suites on changes to non-spec files
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 25/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- angular, typescript
- Ambito
- build-system, testing
Direzione di ricerca
Inizia con la riproduzione collegata, il relativo angular.json test-storybook target e npm run test-storybook. Modifica una story non inclusa o un altro file rilevante e osserva se la build viene ricompilata senza rieseguire i test. Il lavoro è completato quando le modifiche ai file al di fuori dell’include array attivano nuovamente la test suite; a questa issue è già collegata una pull request aperta.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- TypeScript
- Stelle
- 27k
- Fork
- 11.8k
- Merge medio
- 16h 21m
- PR unite (30g)
- 170
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di angular/angular-cli
-
area: @angular/build gemini-triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
angular/angular-cli#34129 ·
-
area: @angular/cli gemini-triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
angular/angular-cli#34057 ·
-
area: @angular/build gemini-triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
angular/angular-cli#33955 ·
-
area: @angular/cli gemini-triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
angular/angular-cli#33055 · 1 commento · 3 reazioni ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34131 · 1 assegnatario ·