riot snapshots
Riot’s current snapshot-management command is riot snapshots, not riot snapshot.
It exists because snapshot testing is not complete without an explicit review workflow.
The three subcommands
Section titled “The three subcommands”riot snapshots reviewriot snapshots approveriot snapshots rejectThey operate on pending *.expected.new files.
Review
Section titled “Review”Use review when you want an interactive pass through the pending diffs:
riot snapshots reviewThe command:
- discovers pending snapshots under the workspace
- skips irrelevant directories like
_buildand.git - shows a diff against the approved file when one exists
- lets you approve, reject, ignore, or quit
This is the right mode when the change needs a human decision.
Approve
Section titled “Approve”Use approve when you already know the pending snapshots are correct:
riot snapshots approveApproval promotes the .expected.new file into the approved .expected file.
Reject
Section titled “Reject”Use reject when the pending candidates are wrong or obsolete:
riot snapshots rejectRejecting removes the pending candidates without touching the approved snapshots.
Query filtering
Section titled “Query filtering”The snapshot commands accept an optional substring query so you can narrow the review set:
riot snapshots review parserriot snapshots approve archiveThat matters once the workspace has more than a handful of pending artifacts.
Why this workflow is good
Section titled “Why this workflow is good”Riot treats .expected.new files as visible review artifacts, not as hidden scratch output.
That is the right tradeoff:
- approved files stay stable
- pending changes are explicit
- review is intentional instead of accidental