pest-testing

Automate Pest PHP test creation, editing, and refactoring in Laravel projects.

Updated Nov 22, 2024
One-click install
npx skills add https://github.com/creamgod45/CGCloud --skill pest-testing-creamgod45
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pest-testing
Source: https://github.com/creamgod45/CGCloud/tree/main/.agents/skills/pest-testing
Command: npx skills add https://github.com/creamgod45/CGCloud --skill pest-testing-creamgod45

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Pest testing in Laravel projects can be verbose and inconsistent; this skill provides a structured approach to writing and maintaining Pest tests, including browser tests and Livewire components, to improve reliability and developer velocity.

Core Features & Use Cases

  • Supports Pest's test() and it() styles with clear, readable assertions.
  • Guides test organization across tests/Feature, tests/Unit, and tests/Browser, including browser testing and datasets.
  • Facilitates migration from PHPUnit to Pest, enabling TDD workflows and mock usage for robust test suites.

Quick Start

Create Pest tests using php artisan make:test --pest and run them with php artisan test.

Frequently Asked Questions about pest-testing

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

FAQPage Schema
How do I structure Pest PHP tests in a Laravel project?

Pest PHP tests in Laravel are structured by organizing files across tests/Feature, tests/Unit, and tests/Browser directories. This skill enforces test organization rules and Pest 4 patterns to build reliable, scalable test suites.

What's the best way to migrate PHPUnit tests to Pest in Laravel?

Migrating PHPUnit tests to Pest in Laravel is facilitated by refactoring existing test cases into Pest's test() and it() styles. This skill enables TDD workflows and uses clear, readable assertions to transition PHPUnit test suites into Pest syntax.

How do I use datasets and mocking with Pest PHP tests?

Use datasets and mocking with Pest PHP tests by applying Pest 4 usage patterns within your test creation and editing workflows. This skill guides dataset usage and mock integration to enable robust test suites for Laravel applications.

Does Pest PHP support browser testing and Livewire components in Laravel?

Pest PHP supports browser testing and Livewire components in Laravel by guiding test creation within the tests/Browser directory. This skill integrates browser testing workflows with Laravel testing tools to maintain reliable test coverage.

Why are my Pest PHP tests verbose and inconsistent across Feature and Unit directories?

Pest PHP tests become verbose and inconsistent without a structured approach to writing and maintaining them. This skill provides standardized test creation, editing, and refactoring workflows to improve reliability and developer velocity.