pest-testing

Write and run Pest 4 tests for Laravel applications including browser and architecture tests.

1|Updated Mar 24, 2026
One-click install
npx skills add https://github.com/MoisesCorcho/anime-recommender --skill pest-testing-moisescorcho
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: pest-testing
Source: https://github.com/MoisesCorcho/anime-recommender/tree/main/.agents/skills/pest-testing
Command: npx skills add https://github.com/MoisesCorcho/anime-recommender --skill pest-testing-moisescorcho

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing tests in Laravel projects requires consistent Pest syntax, correct assertion choices, and knowledge of Pest 4 features like browser testing and smoke testing, which developers often get wrong or skip entirely. ## Core Features & Use Cases - Pest Test Authoring: Create unit, feature, and browser tests using it()/expect() syntax, datasets, and proper mocking with Pest\Laravel helpers. - Browser & Smoke Testing: Run real-browser tests with visit/click/fill interactions and validate multiple pages for JavaScript errors in one pass. - Architecture Testing: Enforce code conventions with arch() rules such as controller suffix and inheritance checks. - Use Case: After changing a password reset flow, ask the AI to write a Pest browser test that visits the sign-in page, submits the reset form, and asserts the notification was sent. ## Quick Start Write a Pest feature test for the anime search endpoint that asserts a successful JSON response and uses a dataset for invalid query inputs.

Frequently Asked Questions about pest-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a Pest test in Laravel?▼

Create a test with vendor/bin/sail artisan make:test --pest {name}, then define cases using it() and expect() inside tests/Feature or tests/Unit. Run it with vendor/bin/sail artisan test --compact --filter=testName.

How to use datasets in Pest for repetitive validation tests?▼

Chain ->with([...]) onto an it() test to pass named datasets, where each array entry becomes test arguments. This avoids duplicating test bodies for multiple input values like email validation cases.

Does Pest 4 support browser testing in Laravel?▼

Yes, Pest 4 browser tests live in tests/Browser and use visit() to load real pages, then click, fill, and assert content. You can also assert no JavaScript errors, fake notifications, and use RefreshDatabase for clean state.

Why should I use assertSuccessful instead of assertStatus(200)?▼

assertSuccessful() is the specific Pest/Laravel assertion for 2xx responses and reads more clearly than assertStatus(200). The same pattern applies to assertNotFound() for 404 and assertForbidden() for 403.

When should I not use this Pest testing skill?▼

Do not use it for non-test PHP code such as factories, seeders, migrations, controllers, or models. It is scoped strictly to writing, fixing, and refactoring tests in Laravel projects.