Skip to content

Allow to pass --update to vitest #32218

Description

@Christian24

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?

Activity

  1. added theissue type on Jan 5, 2026
  2. added 4 commits that reference this issue on Jan 10, 2026
    134f58e
    aea6f85
    750a85c
    9e02e28
  3. rubiesonthesky commented on Mar 27, 2026

    @rubiesonthesky

    Is there any other way to get this work? It seems that the PR has stalled :/

    It would be nice if there would be some documentation what options ng test supports.

  4. added a commit that references this issue on Apr 2, 2026
    dd3a042
  5. jermowery commented on May 12, 2026

    @jermowery

    What is the ETA for a fix for this to be delivered?

  6. toomy4 commented on Jun 8, 2026

    @toomy4

    There is a workaround for this:
    vitest can read the update flag from either the --update flag OR from environment variable UPDATE_SNAPSHOT, so when running ng test with vitest as the test runner, you can do:
    UPDATE_SNAPSHOT=all ng test

    See in vitest repo:
    http://github.com/vitest-dev/vitest/blob/361cf5ddebf625b355b88757a84731b1c0f1b755/packages/vitest/src/node/config/resolveConfig.ts#L617

  7. cheesi commented on Jul 27, 2026

    @cheesi

    It is absolutely ridiculous, that there is still no fix for this issue over half a year later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions