← ClaudeAtlas

pestlisted

Pest testing framework conventions and practices. Invoke whenever task involves any interaction with Pest — writing function-style tests (test/it/describe), the expect() expectation API, datasets, hooks, architecture/mutation/type-coverage/browser testing, Pest.php configuration, or running the pest CLI.
xobotyi/cc-foundry · ★ 23 · AI & Automation · score 81
Install: claude install-skill xobotyi/cc-foundry
# Pest **Tests are functions, not classes. Write the expectation, not the ceremony — `expect($x)->toBe($y)`, and let the description say what the code does.** Pest is a testing framework built on the PHPUnit engine: closures instead of test-case methods, an `expect()` expectation API instead of `$this->assert*`, and first-class architecture, mutation, type-coverage, and browser testing. `$this` inside a test closure is a PHPUnit `TestCase`, so the full PHPUnit assertion and test-double API stays available. All patterns target Pest 4 on PHP 8.5+ (it runs on the PHPUnit 12 engine; its own floor is PHP 8.3). This skill governs Pest-specific decisions. It does **not** restate universal testing philosophy (test behavior not implementation, arrange-act-assert, isolation, mock at boundaries), the PHPUnit assertion/double API, coverage attributes, or `phpunit.xml` internals — those live in the **`phpunit`** skill and apply unchanged here. ## References - **Full expectation catalog + modifiers, higher-order & custom expectations** → [`${CLAUDE_SKILL_DIR}/references/expectations.md`] — every `expect()` method by category, `not`/`and`/`each`/`sequence`, `expect()->extend()`/`intercept()`/`pipe()` - **Architecture testing — `arch()` rules and presets** → [`${CLAUDE_SKILL_DIR}/references/architecture.md`] — all arch expectations, `php`/`security`/`laravel`/`strict` presets, modifiers, wildcards - **Mutation, type coverage, snapshot, stress, browser testing** → [`${CLAUDE_SKIL