pest-testing

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

Updated Aug 24, 2026
One-click install
npx skills add https://github.com/Mantis-Technology/mantis-laravel --skill pest-testing-mantis-technology
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: pest-testing
Source: https://github.com/Mantis-Technology/mantis-laravel/tree/main/.agents/skills/pest-testing
Command: npx skills add https://github.com/Mantis-Technology/mantis-laravel --skill pest-testing-mantis-technology

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing consistent, correct Pest tests in Laravel projects requires knowing framework-specific conventions, assertion patterns, and Pest 5 features like Tia and browser testing, which are easy to get wrong without guidance. ## Core Features & Use Cases - Test Authoring: Generate unit, feature, and browser tests using correct test()/it() conventions, datasets, mocking, and specific assertions like assertSuccessful(). - Pest 5 Capabilities: Apply Test Impact Analysis (--tia), time-balanced sharding, new validation expectations, smoke testing, and architecture tests. - Use Case: After changing a controller, ask the AI to fix the broken feature tests, convert legacy PHPUnit tests to Pest, and rerun only affected tests with ./vendor/bin/pest --parallel --tia. ## Quick Start Ask the AI to write a Pest feature test for a Laravel endpoint and run it with php artisan test --compact --filter.

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?▼

Generate the file with php artisan make:test --pest SomeControllerTest, then define tests using test() or it() with expect() assertions. Match the convention of existing tests in the same directory and run with php artisan test --compact --filter=testName.

How to convert PHPUnit tests to Pest in Laravel?▼

Rewrite PHPUnit class-based tests as Pest test() or it() closures using expect() for assertions and Pest datasets for repetitive cases. Keep files in tests/Feature or tests/Unit and use Pest\Laravel helpers like mock for mocking.

Does Pest support browser testing in Laravel?▼

Yes, Pest 5 browser tests live in tests/Browser and run in real browsers using visit(), click(), fill(), and assertNoJavaScriptErrors(). They support Laravel features like Event::fake(), RefreshDatabase, multiple browsers, devices, and screenshots.

What is Pest Tia and how do I run only affected tests?▼

Tia (Test Impact Analysis) reruns only tests affected by recent changes and replays cached results for the rest. Run it with ./vendor/bin/pest --parallel --tia; it detects Laravel, Symfony, Livewire, and Inertia automatically.

Why should I avoid assertStatus(200) in Pest tests?▼

Specific assertions like assertSuccessful(), assertNotFound(), and assertForbidden() are preferred over assertStatus() because they express intent clearly. Using assertStatus(200) is listed as a common pitfall in Laravel Pest conventions.