testing-pest

Generate comprehensive Pest test suites for Laravel projects including tests for controllers, services, Livewire components, commands, jobs, and models with proper describe blocks for organization, mocking setup, happy path and failure scenarios, RefreshDatabase trait, and coverage for all public methods. Use this skill when creating test files for new features, adding test coverage for controllers or services, writing tests for API endpoints, testing Livewire components, ensuring proper test structure with beforeEach and describe blocks, implementing mocking strategies, or writing dataset-driven tests. This skill applies when working on files in tests/Feature/ or tests/Unit/ directories, creating Pest test files, or ensuring comprehensive test coverage.

⭐5stars🔀1forks📁View on GitHub🕐Updated Jan 11, 2026

When & Why to Use This Skill

This Claude skill automates the generation of comprehensive Pest test suites for Laravel applications, significantly accelerating the development lifecycle. It streamlines the creation of structured, high-quality tests for controllers, services, Livewire components, and models, ensuring robust code coverage through automated mocking, dataset-driven scenarios, and adherence to Laravel testing best practices.

Use Cases

  • Feature Development: Automatically generate integration tests for new Laravel features to ensure seamless functionality from the start.
  • API Reliability: Create exhaustive test cases for API endpoints, covering happy paths, edge cases, and failure scenarios to ensure robust backend performance.
  • Livewire Component Testing: Rapidly script interactive tests for Livewire components to validate user interface behavior and state management.
  • Legacy Code Coverage: Quickly add unit and feature tests to existing Laravel services and models to improve project stability and prevent regressions.
  • Dependency Mocking: Implement sophisticated mocking strategies for external services and HTTP requests using Saloon MockClient to isolate test environments.
  • Database Integrity: Utilize the RefreshDatabase trait and dataset-driven tests to verify complex model relationships and database interactions across multiple data points.
nameTesting Pest
descriptionGenerate comprehensive Pest test suites for Laravel projects including tests for controllers, services, Livewire components, commands, jobs, and models with proper describe blocks for organization, mocking setup, happy path and failure scenarios, RefreshDatabase trait, and coverage for all public methods. Use this skill when creating test files for new features, adding test coverage for controllers or services, writing tests for API endpoints, testing Livewire components, ensuring proper test structure with beforeEach and describe blocks, implementing mocking strategies, or writing dataset-driven tests. This skill applies when working on files in tests/Feature/ or tests/Unit/ directories, creating Pest test files, or ensuring comprehensive test coverage.

Testing Pest

When to use this skill

  • When creating test files for new Laravel features or classes
  • When adding test coverage for controllers, services, or API endpoints
  • When writing tests for Livewire components with user interactions
  • When testing Artisan commands or queued jobs
  • When ensuring proper test structure with describe blocks and beforeEach hooks
  • When implementing mocking strategies for external dependencies
  • When writing dataset-driven tests for multiple scenarios
  • When testing model relationships and database interactions
  • When working on files in tests/Feature/ directory (integration tests)
  • When working on files in tests/Unit/ directory (isolated unit tests)
  • When creating comprehensive test coverage including happy paths and failures
  • When using RefreshDatabase trait for database tests
  • When mocking HTTP requests with Saloon MockClient

This Skill provides Claude Code with specific guidance on how to adhere to coding standards as they relate to how it should handle testing pest.

Instructions

For details, refer to the information provided in this file: testing pest