laravel:tdd-with-pest

Automate Laravel test-driven development workflows with Pest or PHPUnit.

1|1|Updated Dec 15, 2024
One-click install
npx skills add https://github.com/Alejocabeza/dotfiles --skill laravel-tdd-with-pest
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel:tdd-with-pest
Source: https://github.com/Alejocabeza/dotfiles/tree/main/opencode/skills/laravel-tdd-with-pest
Command: npx skills add https://github.com/Alejocabeza/dotfiles --skill laravel-tdd-with-pest

SYSTEM DOCUMENTATION & REQUIREMENTS

## What problem does it solve? Writing tests first in a Laravel project guides development, ensures behavior matches expectations, and helps catch regressions early by driving design with Pest or PHPUnit.

## Core Features & Use Cases

  • RED-GREEN-REFACTOR workflow for Laravel apps using Pest by default (or PHPUnit).
  • Use of factories, feature tests for HTTP endpoints, and unit tests for services.
  • Supports parallel test execution to speed up feedback loops.
  • Works with Sail or non-Sail environments.

### Quick Start Run a test-driven development cycle by writing your first failing test, then implement minimal code to pass, and refactor for clarity.

Frequently Asked Questions about laravel:tdd-with-pest

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

FAQPage Schema
What is the RED-GREEN-REFACTOR workflow for Laravel testing?

The RED-GREEN-REFACTOR workflow is a test-driven development cycle where you write a failing test first, implement minimal code to pass it, and then refactor for clarity. This Skill automates that discipline for Laravel apps using Pest.

How do I write feature and unit tests for Laravel APIs using Pest?

You can build feature and unit tests for Laravel APIs by applying the test-driven development workflow with Pest. This approach supports testing HTTP endpoints, controllers, and services while using factories to generate realistic test data.

Can I use PHPUnit instead of Pest for test-driven development in Laravel?

Yes, you can use PHPUnit instead of Pest for test-driven development in Laravel. While Pest is the default configuration, the workflow fully supports PHPUnit for building and maintaining your feature and unit tests.

Do I need factories to run Laravel tests with this workflow?

Yes, you need factories to provide realistic data for your tests. The workflow requires a configured Laravel project with factories to properly execute feature tests for HTTP endpoints and unit tests for services.

Does this Laravel testing workflow support parallel test execution?

Yes, this Laravel testing workflow supports parallel test execution to speed up your feedback loops. This applies to both Pest and PHPUnit configurations within Sail or non-Sail environments.

What's the best way to start test-driven development in a Laravel project?

The best way to start test-driven development in a Laravel project is to run a cycle by writing your first failing test, implementing the minimal code needed to pass it, and refactoring for clarity using Pest or PHPUnit.