You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
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
Activity
build: add 'update' option for Vitest runner and corresponding tests
build: add 'update' option for Vitest runner and corresponding tests
build: add 'update' option for Vitest runner and corresponding tests
build: add 'update' option for Vitest runner and corresponding tests
rubiesonthesky commentedon Mar 27, 2026
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 testsupports.fix(@angular/build): add update option to vitest unit-test builder
jermowery commentedon May 12, 2026
What is the ETA for a fix for this to be delivered?
toomy4 commentedon Jun 8, 2026
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 testSee in vitest repo:
http://github.com/vitest-dev/vitest/blob/361cf5ddebf625b355b88757a84731b1c0f1b755/packages/vitest/src/node/config/resolveConfig.ts#L617
cheesi commentedon Jul 27, 2026
It is absolutely ridiculous, that there is still no fix for this issue over half a year later.