
Pest Testing
This one activates when you're writing or debugging Pest 4 tests in PHP projects. It pushes you toward idiomatic Pest patterns like using specific assertions (assertSuccessful instead of assertStatus(200)), datasets for repetitive validation tests, and proper browser test structure with assertNoJavascriptErrors. The skill includes examples for browser testing, smoke testing, visual regression, and architecture tests. It's opinionated about test organization and won't let you casually delete tests without approval, which is actually useful discipline. If you're doing TDD in Laravel or just need to verify functionality works, this keeps you from writing tests that look like PHPUnit with a Pest hat on.
- skills.sh installs
- 729
- GitHub stars
- 647
- last updated
- Aug 21, 2026
Install
$ npx -y skills add spatie/freek.dev --skill pest-testing --agent claude-codeInstalls into .claude/skills of the current project.
Files
Pest Testing 4
When to Apply
Activate this skill when:
- Creating new tests (unit, feature, or browser)
- Modifying existing tests
- Debugging test failures
- Working with browser testing or smoke testing
- Writing architecture tests or visual regression tests
Documentation
Use search-docs for detailed Pest 4 patterns and documentation.
Basic Usage
Creating Tests
All tests must be written using Pest. Use php artisan make:test --pest {name}.
Test Organization
- Unit/Feature tests:
tests/Featureandtests/Unitdirectories. - Browser tests:
tests/Browser/directory. - Do NOT remove tests without approval - these are core application code.
Basic Test Structure
it('is true', function () { expect(true)->toBeTrue(); });
Running Tests
- Run minimal tests with filter before finalizing:
php artisan test --compact --filter=testName. - Run all tests:
php artisan test --compact. - Run file:
php artisan test --compact tests/Feature/ExampleTest.php.
Assertions
Use specific assertions (assertSuccessful(), assertNotFound()) instead of assertStatus():
Sponsors
Details
- Repository
- github.com/spatie/freek.dev
- Categories
- Testing & QA, Documentation, Debugging, Automation & Workflows, PHP & Laravel
- First seen
- Jun 3, 2026