← ClaudeAtlas

labrodev-testinglisted

Use when writing or reviewing Pest tests in a Labrodev Laravel project: Unit tests mirroring the code tree (Actions, Rules, Services, Data validation), end-to-end Feature tests through controllers, domain-state helpers in tests/Pest.php, or the mandatory Pest architecture test suite that mechanically enforces the playbook.
labrodev/laravel-playbook · ★ 0 · Testing & QA · score 73
Install: claude install-skill labrodev/laravel-playbook
# Testing: Pest strategy and architecture tests Part of the Labrodev playbook. **The law for this component lives in the always-on `labrodev-testing` guideline** (musts, must-nots); the per-file checklist is `rules/tests.md`. This skill holds the craft: anatomy, canonical templates, and edge cases. ## What to test at which level | Component | When to test | Assert | |---|---|---| | Action | Always, when it mutates state / enforces rules / coordinates objects | Resulting state changes, return value, thrown **named domain exception** on failed guards | | Pipeline-orchestrating Service | When it exists | Final workflow outcome, side effects (state, dispatched events) — not internal step order | | Rule | Always — ideal unit tests | Boolean decisions across edge cases; avoid DB access when possible | | Service | When logic is non-trivial | Inputs → outputs; pure Services testable without Laravel bootstrapping | | Pipeline | When step order or payload transforms matter | Final payload state only | | Data | When validation rules are non-trivial | `ValidationException` on invalid raw input via `validateAndCreate()` | | Job | When retry/backoff/dispatch matters | Delegation + queue configuration, nothing else | | Event/Listener | Listeners with important side effects | Correct Action is called | | Controller (Feature) | Few, high-level, end-to-end | Status/redirect, auth/authorization wiring (403s from the can-trio), record persisted | ## File layout — two suites mirroring the cod