Partial snapshot state after an interrupted Vitest update run
0 reputation · 26 Mar 2021, 00:27 UTC
Goal
Determine whether Vitest offers a documented way to restore snapshot files to a consistent state after an interrupted snapshot update or failed upgrade.
Constraints
Vitest writes snapshot files sequentially when --update is enabled. The documentation does not guarantee atomic writes or provide a rollback command. If the process is killed during an update, some snapshot files may be missing or partially written while others remain updated. This behavior is based on Vitest v1.x snapshot handling; future releases may change it.
Specific questions:
- Does Vitest document any atomic snapshot update or rollback mechanism for interrupted runs?
- What is the recommended recovery procedure when a snapshot directory is left in a partial state after a failed upgrade?
- Are partially written snapshot files detected and ignored by subsequent test runs, or do they cause parse failures?