---
title: "Review tests like code · Agent Wranglers"
url: https://agentwranglers.se/playbook/testing/test-quality/review-tests
updated: 2026-10-20
licence: "All rights reserved"
---

# Review tests like code

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

- Level: Recommended
- Chapter: [Test quality](https://agentwranglers.se/playbook/testing/test-quality)
- Rule: Review test code with the same care as production code. It must be clear, small and free of copy and paste.
- How: Check that each test name states a behaviour and that the setup is short. Share setup through factories and helpers, not copied blocks. Reject tests that only check that a mock was called with the code's own arguments.
- Check: The linter and type checker run on test files with the same settings as production code. A copy-and-paste detector, such as jscpd or PMD CPD, fails the check on duplicated blocks in tests. The [code review questions](https://agentwranglers.se/playbook/architecture/code-review) cover the test files in every pull request.

**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/review-tests`.

- Previous: [Make every test able to fail](https://agentwranglers.se/playbook/testing/test-quality/tests-can-fail)
- Next: [Keep snapshot tests small and reviewed](https://agentwranglers.se/playbook/testing/test-quality/small-snapshots)
- [Test quality](https://agentwranglers.se/playbook/testing/test-quality)
