pest-testing

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

Updated Aug 5, 2026
One-click install
npx skills add https://github.com/rizalord/livecode-ptbeon --skill pest-testing-rizalord
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: pest-testing
Source: https://github.com/rizalord/livecode-ptbeon/tree/main/src/backend/.grok/skills/pest-testing
Command: npx skills add https://github.com/rizalord/livecode-ptbeon --skill pest-testing-rizalord

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing consistent, modern PHP tests in Laravel projects requires knowing Pest-specific syntax, conventions, and tooling, and mistakes like wrong assertion choices or misnamed test files slow down development. ## Core Features & Use Cases - Pest Test Authoring: Generate unit, feature, and browser tests using test()/it()/expect() syntax, datasets, and mocking with correct artisan commands. - Pest 5 Capabilities: Apply Test Impact Analysis (--tia), time-balanced sharding, new validation expectations, smoke testing, and architecture testing. - Use Case: After changing a controller, run only the affected tests with ./vendor/bin/pest --parallel --tia, then add a dataset-driven validation test for the new form request. ## Quick Start Ask the assistant to write a Pest feature test for a specific Laravel endpoint, for example: write a Pest test that posts to /api/docs and asserts a successful response.

Frequently Asked Questions about pest-testing

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

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

Run php artisan make:test --pest {name} where the name excludes the suite prefix, so SomeControllerTest generates tests/Feature/SomeControllerTest.php. Add --unit for unit tests, and match the existing test() or it() convention in the target directory.

How do I run only tests affected by recent code changes?▼

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

What is the difference between assertStatus and assertSuccessful in Pest?▼

assertSuccessful() is the preferred specific assertion over assertStatus(200), and similar specific assertions exist like assertNotFound() for 404 and assertForbidden() for 403. Specific assertions produce clearer failure messages.

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(), model factories, and RefreshDatabase.

Why does make:test create a duplicated Feature/Feature directory?▼

This happens when the {name} argument includes the suite prefix, such as Feature/SomeFeatureTest. Pass only the test name without the suite folder, since artisan already places the file in the correct tests directory.

When should I not use this Pest testing skill?▼

Do not use it for factories, seeders, migrations, controllers, models, or other non-test PHP code. It is scoped strictly to writing, editing, and running Pest tests in Laravel projects.