Laravel Magazine
Pest 5 Released With Test Impact Analysis, an Agent Plugin, and Evals

Pest 5 Released With Test Impact Analysis, an Agent Plugin, and Evals

Eric Van Johnson ·

Pest just shipped its biggest release since the browser testing plugin landed in version 4, and if your test suite has ever made you go get coffee while it runs, this one's worth paying attention to.

Pest 5 is officially out, and the headline feature is the new Test Impact Analysis engine, or TIA for short. Instead of running your entire suite on every change, TIA tracks which lines of your codebase each test actually touches, then re-runs only the tests affected by your latest diff and replays cached results for everything else. According to the Pest team's own numbers, a typical Laravel test suite that used to take around 10 minutes can replay in roughly 4 seconds when most of the codebase hasn't changed since the last run.

That's not a rounding error. That's the difference between running your tests constantly while you work and running them once before you push and hoping.

What else shipped

An Agent plugin. This one's aimed squarely at the current wave of AI coding assistants. It gives agents like Claude Code a single command to verify that a change actually works, running inside your real test suite rather than trusting whatever the agent claims it did. If you've got a browser plugin installed, it drives a real browser too. For teams letting an AI agent make changes semi-autonomously, this closes a real gap: the agent can now check its own work against your actual tests instead of a hallucinated "looks good to me."

Evals. Pest is leaning into the reality that a growing share of PHP applications now ship AI features of their own, prompts, RAG pipelines, agent tool calls, and those need a different kind of testing than a typical HTTP assertion. Evals give you a way to test non-deterministic AI output against expectations, inside the same it()/expect() syntax you already know, instead of reaching for a separate tool.

PHPStan and Rector support baked in. Static analysis and automated refactoring have historically lived outside your test run. Pest 5 pulls them closer, so a single pest invocation can also flag static analysis issues or apply Rector rules as part of your regular workflow.

The catch: PHP 8.4 and PHPUnit 13 are required

Pest 5 requires PHP 8.4 or greater, and it runs on PHPUnit 13 under the hood. If you're still on PHP 8.2 or 8.3 in production, or you've got a dependency tree that's pinned to PHPUnit 11 or 12, you'll want to sort that out before upgrading. This isn't a surprise given Pest's release cadence, but it's worth checking your CI matrix before you casually bump the version in composer.json on a Friday afternoon.

Should you upgrade now?

If TIA's numbers hold up in your codebase the way they do in the announcement, this is one of those upgrades that pays for itself in the first week just from the time you get back in your local dev loop. For most Laravel teams already running Pest 4 with reasonably current PHP versions, the upgrade path is straightforward: bump the version, run the suite once to let TIA build its initial map, and you're off.

Teams still on PHPUnit directly, or on Pest 3 with an aging PHP version, have more to think about. Treat the PHP 8.4 requirement as your real blocker and plan the PHP upgrade first. Everything else about Pest 5 is additive.

Full release notes and the upgrade guide are on the official Pest documentation site, and Laravel News covered the release with more detail on the TIA engine's internals if you want to dig deeper before you commit.

Stay Updated

Subscribe to our newsletter

Get latest news, tutorials, community articles and podcast episodes delivered to your inbox.

Weekly articles
We send a new issue of the newsletter every week on Friday.
No spam
We'll never share your email address and you can opt out at any time.