Allow to pass --update to vitest

Open
#32,218 4 comments 11 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

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.

Description

angular/build:unit-test area: @angular/build freq1: low severity3: broken type: bug/fix
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?

Dominant language
TypeScript
Stars
27k
Forks
11.8k
Avg merge
16h 35m
Merged PRs (30d)
176

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from angular/angular-cli

All issues in angular/angular-cli

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.