Snapshots
Catch every change to a response.
The first run saves the response to a snapshot file next to your tests; every later run compares against it. Review intentional changes, update the snapshot and commit it with your code.
me.yaml
# curl-runner me.yaml --snapshot --ci-snapshot
global:
snapshot:
dir: __snapshots__
updateMode: failing
requests:
- name: Get profile
url: https://api.example.com/me
snapshot: trueBenefits
No expectations to write
The whole response body becomes the assertion. Any field that changes shows up as a diff.
Deliberate updates
Use -u to update every snapshot, or --update-failing to refresh only the ones that changed.
Strict in CI
--ci-snapshot fails the run when a snapshot is missing instead of quietly writing a new one.
Good for
- Large responses that are tedious to assert field by field
- Locking down a public API’s shape
- Refactors that must not change output
- Reviewing response changes in code review