What is pest-testing?
Use when writing, generating, or improving Pest tests for Laravel — clear intent, good coverage, maintainable structure, and alignment with project testing conventions.
event4u-app/agent-config
Use when writing, generating, or improving Pest tests for Laravel — clear intent, good coverage, maintainable structure, and alignment with project testing conventions.
npx skills add https://github.com/event4u-app/agent-config --skill "src/skills/pest-testing"Quick start
Install it or open the source, trigger it with a clear task, then follow the source workflow.
npx skills add https://github.com/event4u-app/agent-config --skill "src/skills/pest-testing"Use pest-testing to help me with: [describe your task]. Before you begin, tell me what input you need, the steps you will follow, and the expected output.
No structured workflow was detected; follow the original SKILL.md below.
Continue to the workflowDirect answers
Use when writing, generating, or improving Pest tests for Laravel — clear intent, good coverage, maintainable structure, and alignment with project testing conventions.
It is relevant to workflows involving Testing, Engineering, Operations.
SkillSignal detected this source-specific command: npx skills add https://github.com/event4u-app/agent-config --skill "src/skills/pest-testing". Inspect the repository and command before running it.
The upstream source does not declare a dedicated Agent platform.
No obvious permission action was detected by the static rules. This is not proof that the Skill is safe.
This page combines upstream documentation with deterministic repository, quality, and static-risk signals. It is not described as a manual test or security review.
SkillSignal brief
Use when writing, generating, or improving Pest tests for Laravel — clear intent, good coverage, maintainable structure, and alignment with project testing conventions.
Useful in these contexts
Core capabilities
Distilled from the source
About 9 min · 24 sections
Feature tests
Unit tests
API endpoint tests
Model tests
Pest test file with descriptive test names and clear assertions
Tests organized by happy path, validation, edge cases
Quality breakdown
Based on traceable docs and repository signals; stars are not treated as quality.
Compare before choosing
These links are selected from shared tasks, functions, stacks, platforms, and same-name variants. Compare the source owner, documentation, permissions, and maintenance signals.
Use when the user says "review the design", "check the UI", or wants a comprehensive UI/UX review. Uses a 7-phase methodology covering interaction, responsiveness, accessibility, and more.
Test-driven development for Quarkus 3.x LTS using JUnit 5, Mockito, REST Assured, Camel testing, and JaCoCo. Use when adding features, fixing bugs, or refactoring event-driven services.
Expert-level Windows batch file (.bat/.cmd) skill for writing, debugging, and maintaining CMD scripts. Use when asked to "create a batch file", "write a .bat script", "automate a Windows task", "CMD scripting", "batch automation", "scheduled task script", "Windows shell script", or when working with .bat/.cmd files in the workspace. Covers cmd.exe syntax, environment variables, control flow, string processing, error handling, and integration with system tools.
Write and review unit tests for Vue 3 + TypeScript + Vitest + Pinia codebases. Use when creating or updating tests for components, composables, and stores; mocking Pinia with createTestingPinia; applying Vue Test Utils patterns; and enforcing black-box assertions over implementation details.
Build, inspect, test, and analyze bounded process-based discrete-event simulations with SimPy, including events, resources, interrupts, monitoring, replications, warm-up, and reproducible output analysis.
Use this skill for all Laravel testing tasks, especially when working with:
This skill extends php-coder, laravel, and eloquent.
For prevention layers that fire before writing a test — TDD
discipline, mock-isolation gates, and the 12 process rationalizations
("I'll add the test after", "patch first, test later") — see
test-driven-development,
testing-anti-patterns, and
process-anti-patterns.md.
php-coder, laravel, and eloquent where relevant.test-case-discovery funnel; floor per behavior: 1 happy + 1 boundary + 1 error (+1 abuse on security paths).For bug fixes and new features, prefer test-driven development:
Tests written after implementation pass immediately. Passing immediately proves nothing:
For every bug fix: write a failing test that reproduces the bug FIRST, then fix it. The test proves the fix works AND prevents regression.
| Excuse | Reality |
|---|---|
| "Too simple to test" | Simple code breaks. Test takes 30 seconds. |
| "I'll test after" | Tests passing immediately prove nothing. |
| "Manual test is faster" | Manual doesn't prevent regression. You'll re-test every change. |
| "Test is hard to write" | Hard to test = hard to use. Simplify the design. |
| "Need to explore first" | Fine — throw away exploration code, start fresh with TDD. |
| "Existing code has no tests" | You're improving it. Add tests for what you touch. |
RefreshDatabase or the project's standard database reset strategy where appropriate.it() / test() according to existing project conventions.readonly or final on Pest test classes.final if they need to be mocked via Mockery::mock().namespace declaration) treat all PHP built-in classes as global.
Do NOT add use statements for global classes like DateTimeImmutable, Exception,
stdClass, etc. — PHP will warn: "The use statement with non-compound name has no effect".use statements for namespaced classes (e.g., use App\Models\...) are needed.$this->travel(5)->seconds() (Laravel's time travel) to create
a clear gap between "before" and "after" timestamps. Never rely on now() being different
between two lines of code — on fast hardware, they can be identical.null just because the seeder
doesn't set them — previous tests in parallel may have modified the same record.200 — verify meaningful behavior.assertDatabaseHasassertDatabaseMissingcoduo/php-matcherThis project uses coduo/php-matcher for flexible snapshot assertions.
Pattern files live in snapshots/ directories next to the test files.
Use pattern variables instead of hardcoded values in snapshot files. This makes snapshots resilient to data changes while still enforcing type correctness.
| Pattern | Matches | Example |
|---|---|---|
@boolean@ | true or false | 'is_active' => '@boolean@' |
@integer@ | Any integer | 'id' => '@integer@' |
@string@ | Any string | 'name' => '@string@' |
@null@ | null | 'deleted_at' => '@null@' |
@datetime@ | ISO datetime string | 'created_at' => '@datetime@' |
@uuid@ | UUID string | 'uuid' => '@uuid@' |
@array@ | Any array | 'items' => '@array@' |
@double@ | Any float | 'amount' => '@double@' |
@wildcard@ | Anything | 'data' => '@wildcard@' |
Combine with || for nullable fields: 'deleted_at' => '@null@||@datetime@'
$replacements.false) when other booleans in the same file use @boolean@ — be consistent.$variable ?? '@pattern@' syntax to allow test-specific overrides via replacements parameter.PhpMatcherHelper::ruleBackedEnum(EnumClass::class, 'string') for enum fields.// snapshots/user-resource.php
return [
'id' => $id ?? '@integer@',
'name' => $name ?? '@string@',
'email' => $email ?? '@string@',
'is_active' => $is_active ?? '@boolean@',
'created_at' => $created_at ?? '@datetime@',
'deleted_at' => $deleted_at ?? '@null@||@datetime@',
];
expect($response->json())
->toMatchPhpPatternFile(
patternFile: __DIR__ . '/snapshots/user-resource.php',
replacements: ['id' => $user->getId()],
);
Queue::fake()Bus::fake()Event::fake()Mail::fake()Notification::fake()Storage::fake()When reviewing or auditing existing tests, check for these anti-patterns:
| Smell | Description | Fix |
|---|---|---|
| Overmocking | Too many mocks disconnect the test from reality | Replace mocks with real implementations or fakes |
| Fragile tests | Tests break with unrelated changes (e.g., asserting exact JSON structure) | Assert only meaningful fields |
| Flaky tests | Non-deterministic results (time, ordering, parallel state) | Use time travel, explicit ordering, isolated data |
| Giant tests | One test covers 5+ behaviors | Split into focused tests |
| Missing assertions | Test runs code but doesn't verify outcomes | Add meaningful assertions |
| Test duplication | Same scenario tested in multiple places | Consolidate or use datasets |
| Assertion roulette | Many assertions without clear failure messages | Use named assertions or split tests |
| Eager test | Tests too many things, making failures hard to diagnose | One behavior per test |
Queue::fake(), Http::fake()) over manual mocks.When generating Pest tests:
When triaging a verbose run, narrow the output with --filter (Pest)
plus targeted grep/rg instead of re-running the whole suite or
echoing all logs:
# Only run failing tests in one file
vendor/bin/pest tests/Feature/InvoiceTest.php --filter='creates invoice'
# Scan the test log for failures only
rg --color=never '^FAIL|Tests:' storage/logs/pest.log
# Inspect JSON output from data-driven tests
vendor/bin/pest --log-junit=pest.xml && rg '<failure' pest.xml
readonly or final on Pest test helper classes — it breaks mocking.use statements for global classes (Exception, DateTimeImmutable) in Pest files — they're auto-imported.$this->travel(5)->seconds() for time-dependent tests — never rely on now() differing between lines.When generating new tests, focus on:
What NOT to test:
Quality over quantity — 5 meaningful tests beat 20 trivial ones.