pest-testing

Write and refactor Laravel Pest tests for feature, unit, browser, and architecture coverage.

2|Updated Mar 3, 2025
One-click install
npx skills add https://github.com/dspangenberg/opsc --skill pest-testing-dspangenberg
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pest-testing
Source: https://github.com/dspangenberg/opsc/tree/main/.junie/skills/pest-testing
Command: npx skills add https://github.com/dspangenberg/opsc --skill pest-testing-dspangenberg

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you write, fix, and modernize Laravel tests in Pest instead of spending time translating test patterns, debugging broken assertions, or guessing the right testing workflow.

Core Features & Use Cases

  • Pest Test Creation: Create new feature, unit, and browser tests using the project's Pest conventions.
  • Test Refactoring: Convert PHPUnit tests to Pest, add datasets, improve assertions, and align with existing test style.
  • Laravel Testing Workflows: Support TDD, mocking, RefreshDatabase usage, smoke tests, Livewire tests, and architecture checks.
  • Use Case: A developer can ask for help fixing a failing feature test after a code change and get a Pest-ready solution that matches the repo's conventions.

Quick Start

Use the pest-testing skill to convert an existing Laravel test into Pest and add the missing assertions.

Frequently Asked Questions about pest-testing

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

FAQPage Schema
How do I convert PHPUnit tests to Pest in Laravel?

Converting PHPUnit tests to Pest involves refactoring test classes into closure-based syntax, adding datasets, and improving assertions to match existing Laravel project conventions. This modernizes and streamlines your test suite.

What is the best way to write feature and browser tests in Pest for Laravel?

The best way to write feature and browser tests in Pest is using Laravel testing helpers and Pest 4 syntax. You structure tests with datasets and mocking to achieve deterministic validation for endpoints and UI interactions.

Can I use datasets and mocking for TDD workflows in Laravel Pest?

Yes, you can use datasets and mocking for TDD workflows in Laravel Pest. The framework supports test-driven development by validating deterministic outcomes with data providers and mock objects before you write implementation code.

Does Pest support architecture testing and smoke tests in Laravel?

Pest supports architecture testing and smoke tests in Laravel by verifying architectural constraints and validating critical application paths. This ensures core functionality remains stable without breaking existing conventions.

Why refactor existing Laravel tests to Pest syntax?

Refactoring Laravel tests to Pest syntax reduces boilerplate by replacing class-based structures with closures. It enables dataset-driven checks and improved assertions, making tests more readable and maintainable within your workflow.