angular / angular/angular-cli

Allow passing --changed cli option to vitest

Ouverte
#32,343 1 commentaire 9 réactions 0 personnes assignées Voir sur GitHub
angular/build:unit-test area: @angular/build feature feature: votes required
Langage dominant
TypeScript
Étoiles
27k
Forks
11.8k
Merge moyen
14 h 23 min
PR mergées (30 j)
162

Description

### 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.

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par les options du builder de tests unitaires et suivez la manière dont elles sont transmises au runner Vitest. Vérifiez qu’une option string modifiée transmet --changed et que les tests pertinents du builder couvrent la commande obtenue.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
typescript
Domaine
cli, testing
Type d'issue
Fonctionnalité
Difficulté
2/5
Temps estimé
1-3 heures
Activité
À l'abandon
Clarté
Clairement spécifiée
Accessibilité débutants
55/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.