pest-testing

Writes and runs Pest 4 tests for Laravel applications including browser and architecture tests.

1|Updated Jun 6, 2026
One-click install
npx skills add https://github.com/karuhun-developer/ecommerce --skill pest-testing-karuhun-developer
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: pest-testing
Source: https://github.com/karuhun-developer/ecommerce/tree/main/.cursor/skills/pest-testing
Command: npx skills add https://github.com/karuhun-developer/ecommerce --skill pest-testing-karuhun-developer

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing tests in Laravel projects requires consistent Pest syntax, correct assertions, and knowledge of Pest 4 features like browser testing and datasets. This Skill ensures every test you write, fix, or refactor follows Pest conventions and uses the right patterns for unit, feature, browser, and architecture tests. ## Core Features & Use Cases - Pest Test Authoring: Generates tests using test()/it()/expect() syntax, datasets for repetitive validation cases, and proper mocking with Pest\Laravel\mock. - Browser & Smoke Testing: Creates real-browser tests in tests/Browser with page interactions, JavaScript error assertions, multi-device viewports, and smoke tests across multiple pages. - Architecture & Convention Enforcement: Uses arch() tests to enforce code conventions and matches existing project test style before writing new tests. - Use Case: After a code change breaks your suite, ask the AI to fix the failing tests, convert legacy PHPUnit tests to Pest, and add a smoke test verifying your main pages have no JavaScript errors. ## Quick Start Write a Pest feature test for the checkout flow 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?▼

Create tests with php artisan make:test --pest {name}, then use test() or it() functions with expect() assertions. Match the convention of existing tests in the same directory, and place files in tests/Feature or tests/Unit.

How to run a single Pest test in Laravel?▼

Run php artisan test --compact --filter=testName to execute a single test by name. You can also run an entire file with php artisan test --compact tests/Feature/ExampleTest.php or the full suite with php artisan test --compact.

Does Pest 4 support browser testing in Laravel?▼

Yes, Pest 4 includes browser testing that runs in real browsers. Tests live in tests/Browser and support clicking, filling forms, scrolling, multiple browsers and devices, dark mode, screenshots, and assertNoJavaScriptErrors() checks.

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

assertSuccessful() is the preferred specific assertion for HTTP 200 responses, while assertStatus(200) is the generic form. Pest conventions favor specific assertions like assertNotFound() and assertForbidden() over assertStatus(404) or assertStatus(403).

When should I use datasets in Pest tests?▼

Use datasets for repetitive tests such as validation rules where the same logic runs against multiple inputs. Chain ->with([...]) onto a test to pass named or indexed data sets, avoiding duplicated test code.

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, fixing, and refactoring tests within Laravel projects using Pest.