write-pest-test
Installation
SKILL.md
Write Pest PHP Test
When To Use
Use this skill when introducing tests for newly written features or writing regression tests using Pest PHP.
Workflow
- Verify setup: Ensure Pest is initialized in
tests/Pest.php. - Scaffold test file: Place files under
tests/Feature/ortests/Unit/with.phpsuffix. - Use descriptive test blocks: Write tests using
it('does something', ...)ortest('does something', ...). - Mock Side-effects: Stub out mail, events, notifications, and queues.
- Assert JSON payloads & database state: Use Pest expectations
$this->assertDatabaseHas()and$response->assertJson().