laravel-pest5-upgrade

Upgrade Laravel projects from Pest 4 to Pest 5 and enable Test Impact Analysis.

3|Updated Apr 11, 2026
One-click install
npx skills add https://github.com/bravros/bravros --skill laravel-pest5-upgrade-bravros
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: laravel-pest5-upgrade
Source: https://github.com/bravros/bravros/tree/main/plugins/tools/skills/laravel-pest5-upgrade
Command: npx skills add https://github.com/bravros/bravros --skill laravel-pest5-upgrade-bravros

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Upgrading a PHP/Laravel test suite from Pest 4 to Pest 5 and enabling Test Impact Analysis (TIA) involves hidden traps: TIA aborts entire runs on leftover PHPUnit class-style tests, transitive dependency bumps cause unrelated failures, and misconfigured default branches make TIA over-select tests. This Skill provides a measured, checkpoint-driven migration path that turns slow full test runs into impact-filtered ones. ## Core Features & Use Cases - Guided Pest 4 to 5 upgrade: Narrow composer update, fallout attribution via composer.lock diffs, and version checkpoints. - PHPUnit-to-Pest conversion: Mapping tables, helper-collision traps, dataset merging, and assertion-count verification for class-style tests. - TIA configuration and operations: Correct defaultBranch setup, storage and worktree behavior, flake diagnosis with ->repeat(100), and guidance on CI baseline sharing pitfalls. - Use Case: A Laravel team with an 18,000-test suite wants local runs to execute only tests affected by the current diff; this Skill walks them through the upgrade, conversion, and TIA setup with checkpoints at each step. ## Quick Start Upgrade my Laravel project from Pest 4 to Pest 5 and enable Test Impact Analysis so local test runs only execute affected tests.

Frequently Asked Questions about laravel-pest5-upgrade

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

FAQPage Schema
How do I upgrade a Laravel project from Pest 4 to Pest 5?▼

Run composer update pestphp/pest --with-all-dependencies rather than a bare composer update, then verify vendor/bin/pest --version reports 5.x. Expect unrelated fallout from transitive dependencies and diff composer.lock to attribute failures.

How do I enable Test Impact Analysis in Pest 5?▼

Configure pest()->tia()->locally()->filtered() in your Pest configuration and set defaultBranch to the branch features are actually cut from. TIA requires a coverage driver like pcov or Xdebug and only works on Pest-style tests.

Why does TIA fail with WorkerCrashedException after upgrading Pest?▼

TIA aborts the entire run when it encounters any PHPUnit class-style test, surfacing a WorkerCrashedException that names an arbitrary file. Convert all class-style tests to Pest closures and verify with a grep for class declarations in test files.

Does Pest TIA work in git worktrees?▼

Worktrees break two TIA behaviors: baselined() silently no-ops because .git is a file not a directory, and each worktree gets its own cache key. You can seed a new worktree by copying the graph directory printed by vendor/bin/pest --baseline.

Should I run Pest TIA on CI pipelines?▼

No, Pest's documentation states TIA is built for local development and should not be added to the CI test command. The single sanctioned exception is a dedicated baseline-recording job; PR pipelines should keep running the full suite.

Why do new flaky tests appear after enabling TIA?▼

A filtered suite runs the same test many times per session, exposing factory randomness that full runs hid. Measure the failure rate with ->repeat(100), then fix the fixture at the call site rather than changing shared factories.