pest-testing

Writes and runs Pest 4 PHP tests including unit, feature, browser, and architecture tests.

1|Updated Mar 2, 2026
One-click install
npx skills add https://github.com/mst-software-vn/mst-checkscam --skill pest-testing-mst-software-vn
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: pest-testing
Source: https://github.com/mst-software-vn/mst-checkscam/tree/main/.claude/skills/pest-testing
Command: npx skills add https://github.com/mst-software-vn/mst-checkscam --skill pest-testing-mst-software-vn

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing and maintaining PHP tests with the Pest 4 framework requires knowing its specific conventions, assertion styles, datasets, mocking imports, and browser testing APIs, which are easy to get wrong without guidance. ## Core Features & Use Cases - Test Creation & Organization: Generate unit, feature, and browser tests with php artisan make:test --pest, placed in the correct tests/Feature, tests/Unit, or tests/Browser directories. - Pest 4 Capabilities: Apply browser testing, smoke testing, visual regression, test sharding, and architecture testing with correct syntax. - Best-Practice Assertions: Use specific assertions like assertSuccessful() instead of assertStatus(200), plus datasets and proper mocking via use function Pest\Laravel\mock;. - Use Case: When adding a password reset flow to a Laravel app, generate a Pest browser test that visits the sign-in page, clicks through the reset flow, and asserts the notification was sent. ## Quick Start Write a Pest feature test for the login endpoint and run it with a filtered artisan test command.

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

Create a Pest test by running php artisan make:test --pest {name}. Unit and feature tests go in tests/Unit and tests/Feature, while browser tests belong in tests/Browser.

How to run a single Pest test file or filter tests?▼

Run a filtered test with php artisan test --compact --filter=testName, or run a specific file with php artisan test --compact tests/Feature/ExampleTest.php. Use php artisan test --compact to run the full suite.

Does Pest 4 support browser testing?▼

Yes, Pest 4 includes browser testing that runs in real browsers like Chrome, Firefox, and Safari. Tests live in tests/Browser and support clicking, typing, scrolling, screenshots, multiple viewports, and light or dark color schemes.

Why does Pest mocking fail with an undefined function error?▼

Mocking fails when the mock function is not imported. Add use function Pest\Laravel\mock; at the top of the test file before calling mock().

When should I use datasets in Pest tests?▼

Use datasets for repetitive tests such as validation rules where the same logic runs against many inputs. Chain ->with([...]) onto the test to provide named or indexed data sets.