Testing Pest

Generate Pest test suites for Laravel projects covering controllers, services, and API endpoints.

Updated Oct 31, 2025
One-click install
npx skills add https://github.com/FlorianRiquelme/statamic-assets --skill testing-pest
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Testing Pest
Source: https://github.com/FlorianRiquelme/statamic-assets/tree/main/.claude/skills/testing-pest
Command: npx skills add https://github.com/FlorianRiquelme/statamic-assets --skill testing-pest

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automates the creation of well-structured and comprehensive Pest test suites for Laravel applications, ensuring high code quality, reducing manual testing effort, and accelerating development cycles.

Core Features & Use Cases

  • Full Coverage: Generates tests for controllers, services, Livewire components, commands, jobs, and models.
  • Best Practices: Incorporates proper describe blocks for organization, mocking setup, happy path, and failure scenarios.
  • Use Case: When a new API endpoint is created, this skill ensures a full suite of Pest tests is generated, covering various request scenarios, validation, and expected outcomes, including database interactions.

Quick Start

Write a Pest feature test for the 'create user' API endpoint, covering successful creation and validation failures.

Frequently Asked Questions about Testing Pest

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

FAQPage Schema
How do I generate comprehensive Pest tests for Laravel controllers and API endpoints?

Pest test generation for Laravel automates creation of test suites covering controllers, services, and API endpoints with describe blocks, mocking, happy-path and failure scenarios, and RefreshDatabase integration to ensure comprehensive coverage aligned with Pest coding standards.

What should a well-structured Laravel unit test include for TDD workflows?

Well-structured unit tests for TDD include organized describe blocks, beforeEach hooks for setup, proper mocking strategies, both success and failure test cases, and dataset-driven tests to validate behavior comprehensively before implementation.

Can I generate tests for Livewire components and Laravel jobs with Pest?

Yes, Pest test generation covers Livewire components, Laravel jobs, commands, models, and services with appropriate mocking and integration strategies to ensure full coverage across your feature and unit test directories.

How does Pest handle database interactions and validation failures in integration tests?

Pest integration tests use RefreshDatabase for database isolation and generate test cases for both validation successes and failures, API request scenarios, and expected outcomes to verify controller and service behavior end-to-end.

What's the best way to organize Pest tests for a Laravel feature with multiple scenarios?

Organize Pest tests using describe blocks for logical grouping, beforeEach hooks for shared setup, separate test cases for happy paths and edge cases, and dataset-driven tests to cover validation rules and expected responses systematically.