angular / angular/angular-cli

Allow to pass --update to vitest

Open
#32,218 4 comments 11 reactions 0 assignees View on GitHub
angular/build:unit-test area: @angular/build freq1: low severity3: broken type: bug/fix
Dominant language
TypeScript
Stars
27k
Forks
11.8k
Avg merge
14h 23m
Merged PRs (30d)
162

Description

### Command

test

### Description

Vitest has an update command, that updates the visual regression screenshots and the snapshots. However, it is currently impossible to invoke this command, because the Angular CLI does not seem to pass it on to vitest. Just running `vitest --update` fails as well, because it is missing the vitest.config that Angular CLI seems to create in memory.

### Describe the solution you'd like

Pass the `--update` flag vitest execution.

### Describe alternatives you've considered

Maybe all arguments preceded by `--` could be automatically passed on?

Contributor guide

Open the contributing guide

Research direction

Start at the Angular CLI `test` command's argument handling and reproduce the issue with Vitest's `--update` flag. Trace how the in-memory Vitest configuration is provided, then verify that the flag reaches Vitest without requiring a separate configuration file; done means visual regression screenshots and snapshots can be updated through the CLI.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli, testing
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.