pest-testing

Create, execute, and maintain Pest PHP tests in Laravel projects.

Updated Dec 20, 2024
One-click install
npx skills add https://github.com/MrEddie7/DS_AMS_ETEC --skill pest-testing-mreddie7
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pest-testing
Source: https://github.com/MrEddie7/DS_AMS_ETEC/tree/main/3%20ano/Atividades/2%20Bimestre/PW%20ll/breeze-etec/.agents/skills/pest-testing
Command: npx skills add https://github.com/MrEddie7/DS_AMS_ETEC --skill pest-testing-mreddie7

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill resolves the complexity of writing, maintaining, and organizing tests in Laravel applications by providing a standardized, readable, and efficient testing workflow using the Pest framework.

Core Features & Use Cases

  • Test Generation: Quickly scaffold new feature or unit tests using the correct Artisan commands.
  • Pest Syntax Mastery: Provides guidance on using it, test, and expect functions, along with datasets for repetitive validation.
  • Architecture & Type Coverage: Enforces project standards through architecture tests and ensures code quality with type coverage analysis.
  • Use Case: Use this skill when refactoring a legacy PHPUnit test suite to Pest or when implementing TDD for a new Livewire component to ensure high test coverage and clean, maintainable code.

Quick Start

Use the pest-testing skill to generate a new feature test for the UserProfileController and ensure it follows the project naming conventions.

Frequently Asked Questions about pest-testing

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

FAQPage Schema
How do I write Pest PHP tests for a Laravel application?

Pest PHP tests for Laravel are scaffolded using Artisan commands, adhering to Pest 3 syntax, utilizing it, test, and expect functions alongside datasets for repetitive validation scenarios.

What is the best way to refactor PHPUnit tests to Pest in Laravel?

Refactoring PHPUnit tests to Pest involves migrating to Pest 3 syntax, organizing tests in the proper directory, and utilizing architecture validation to enforce project standards.

Can I use Pest for architecture testing and type coverage in Laravel?

Yes, Pest supports architecture testing and type coverage analysis in Laravel, enforcing project standards and ensuring code quality through specific validation rules.

How do I generate a feature test for a Laravel controller using Pest?

Generating a feature test for a Laravel controller using Pest involves running specific Artisan commands to scaffold the test while ensuring it follows project naming conventions and uses specific response assertions.

Does this Pest testing approach support test-driven development for Livewire components?

Yes, this Pest testing approach supports TDD for Livewire components by facilitating test creation and maintenance, ensuring high test coverage and clean, maintainable code.

How do I use datasets for repetitive test validation in Pest PHP?

Using datasets for repetitive test validation in Pest PHP involves leveraging the framework's dataset functionality to run the same test logic against multiple data sets efficiently.