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
Updating snapshots with the latest actual result might be cumbersome. You either need to rerun the whole test suite again with @ForceUpdateSnapshots and then another time without the annotation. Or you need to manually update the snapshot files.
Since 1.7.0 you could enable @SnapshotTestOptions(alwaysPersistActualResult = true). This will always write the latest actual result as a sibling file next to the actual snapshot. Then you could just delete the snapshot and rename the created .snapshot_actual file to .snapshot. This would update the snapshot to the latest actual result without having to rerun the test suite.
If snapshot files are already checked into the SCM, we could consider the following auto update workflow:
If we find a difference to the current snapshot AND the snapshot is checked into SCM AND the snapshot is not marked modified (in terms of git status), then we can auto-update the persisted snapshot with the current actual result. The snapshot file will subsequently be marked modified in git status and the user needs to confirm these modifications by committing the file.
If a snapshot file is marked modified by the SCM we can assume that it has been auto-updated by a previous test run. In that case we always fail the test. The user will need to commit the file in order to clear its status and to confirm the modifications to the snapshot file.
The text was updated successfully, but these errors were encountered:
Updating snapshots with the latest actual result might be cumbersome. You either need to rerun the whole test suite again with
@ForceUpdateSnapshots
and then another time without the annotation. Or you need to manually update the snapshot files.Since 1.7.0 you could enable
@SnapshotTestOptions(alwaysPersistActualResult = true)
. This will always write the latest actual result as a sibling file next to the actual snapshot. Then you could just delete the snapshot and rename the created.snapshot_actual
file to.snapshot
. This would update the snapshot to the latest actual result without having to rerun the test suite.If snapshot files are already checked into the SCM, we could consider the following auto update workflow:
git status
), then we can auto-update the persisted snapshot with the current actual result. The snapshot file will subsequently be marked modified ingit status
and the user needs to confirm these modifications by committing the file.The text was updated successfully, but these errors were encountered: