update
- Type:
boolean | 'new' | 'all' | 'none' - Default:
false - CLI:
-u,--update,--update=false,--update=new,--update=none
Define snapshot update behavior.
trueor'all': updates all changed snapshots and deletes obsolete onesnew: generates new snapshots without changing or deleting obsolete onesnone: does not write snapshots and fails on snapshot mismatches, missing snapshots, and obsolete snapshots
When update is false (the default), Vitest resolves snapshot update mode by environment:
- Local runs (non-CI): works same as
new - CI runs (
process.env.CIis truthy): works same asnone