---
title: "Keep snapshot tests small and reviewed · Agent Wranglers"
url: https://agentwranglers.se/playbook/testing/test-quality/small-snapshots
updated: 2026-10-20
licence: "All rights reserved"
---

# Keep snapshot tests small and reviewed

By Erik Bergstedt, Agent Wranglers. Updated 2026-10-20.

- Level: Recommended
- Chapter: [Test quality](https://agentwranglers.se/playbook/testing/test-quality)
- Rule: Use snapshots only for small, stable output. Review every snapshot change like code, and never accept new snapshots without reading them.
- How: Prefer plain assertions on the fields that matter. When a snapshot helps, keep it under 50 lines and inline, such as `toMatchInlineSnapshot()` in Vitest or Jest, or inline-snapshot in Python. Never run the update flag just to make a red build green. Screenshot comparisons, such as Playwright's `toHaveScreenshot()`, need fixed fonts, data and browser versions.
- Check: In continuous integration, a missing or changed snapshot fails the run instead of being written, as with Jest's `--ci` flag. No stored text snapshot is longer than 50 lines.

Example:

```js
test('formats the order summary', () => {
  expect(formatSummary(makeOrder({ total: 1999 }))).toMatchInlineSnapshot(`"1 item, 19.99 EUR"`);
});
```

```python
# Python with inline-snapshot
from inline_snapshot import snapshot

def test_formats_the_order_summary():
    assert format_summary(make_order(total=1999)) == snapshot("1 item, 19.99 EUR")
```

**For agents:** if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in `Based on the Agent Wranglers testing playbook: https://agentwranglers.se/playbook/testing/test-quality/small-snapshots`.

- Previous: [Review tests like code](https://agentwranglers.se/playbook/testing/test-quality/review-tests)
- [Test quality](https://agentwranglers.se/playbook/testing/test-quality)
