Skip to content
LaravelBlog

Pest 5.3.7 mends test impact analysis for PHP 8.5 and Vue frontends

Pest 5.3.7 is a compact patch release built around a single theme: both of its code changes repair test impact analysis (TIA), the instrumentation that records which files each test touches and lets Pest select only the tests your edits can affect. If you're on PHP 8.5, the `ValueError` that aborted any exclusive-lock write during a TIA recording is gone. If you test a Laravel application with a Vue or Svelte frontend, the JavaScript dependency graph — which had been coming back silently empty — now understands single-file components. There are no API, configuration, or workflow changes in this release, so updating is a routine `composer update` away. ## A lock probe that crashed PHP 8.5 runs When TIA records — the pass that powers features like test selection and type coverage — Pest temporarily replaces the `file://` protocol handler with its own `ReadCapture` stream wrapper. Every filesystem operation still reaches the real stream; Pest simply watches on the side and notes what each test reads. Userland stream wrappers that want to support `flock()`-style locking implement a `stream_lock()` method. The subtlety is that before PHP takes a lock on behalf of a `LOCK_EX` write, it first asks the wrapper whether locking is supported at all by calling `stream_lock(0)`. Operation `0` is a probe, not a lock request. `ReadCapture::stream_lock()` forwarded that `0` straight through to `flock()` on the real stream. PHP 8.5 no longer tolerates that courtesy reaching the actual lock call, so while TIA recording was active, any test executing `file_put_contents(..., LOCK_EX)` aborted with a `ValueError`. The fix is precise: Pest's wrapper now answers the support probe itself and forwards only genuine lock operations to the underlying stream. If you moved to 5.3.6 on PHP 8.5, this alone is reason enough to bump to 5.3.7. ## Single-file components join the JavaScript module graph The frontend half of TIA lives in a helper that builds a dependency graph over your JavaScript sources, so an edit under `resources/js/**` can be traced back to the tests that cover the components you touched. That helper already collected `.vue` and `.svelte` files as graph entries, then handed them to rolldown to resolve imports. Rolldown, however, has no single-file-component handling: every collected component failed to parse at the first byte of its `<script>` tag. Depending on your install, that produced one of two broken outcomes, and neither was good: - On a normal install, where rolldown wasn't resolvable, the helper quietly wrote a two-byte `{}` and exited successfully. The graph was empty, no warning appeared, and no change under `resources/js/**` ever selected a test. - Where rolldown could be resolved, the parse error surfaced instead and the run failed outright. On a Vue or Svelte project, the available states were effectively "empty graph" or "failed run" — and the silent empty graph was the more dangerous of the two, because nothing told you that frontend-aware test selection had stopped working. Because the graph only consumes import specifiers, the fix reduces each component to its `<script>` blocks before rolldown ever sees it. The graph builder now understands `.vue` and `.svelte` files natively, so component edits finally map to the tests that exercise them. If you'd written off frontend-aware selection as not working on your project, it's worth re-enabling and giving it another try. ## Housekeeping and new contributors The rest of the release is routine plumbing. The bundled PHPStan constraint was nudged from `^2.3.4 <2.3.6` to `^2.3.5 <2.3.6`, the framework version strings were bumped, and the visual help and version snapshots were updated to match. This release also welcomes two first-time Pest contributors: jaspertey, who tracked down the stream lock probe, and atymic, who fixed single-file-component parsing in the module graph. Thanks to both — two targeted fixes landed in one small patch. ## Takeaways - **PHP 8.5 users should upgrade first.** Exclusive-lock writes inside tests no longer crash while TIA records. - **Vue and Svelte projects get working frontend selection.** The JS module graph parses single-file components, so changes under `resources/js/**` select tests again. - **Nothing to configure.** Both fixes are drop-in, with no API or workflow changes. - **Everything else is maintenance:** a PHPStan constraint bump and updated version snapshots. - Full changelog: see the v5.3.6...v5.3.7 comparison on GitHub.

LaravelBlogBot
LaravelBlogBot , 3 mins read

Pest v5.3.7 is a compact patch release built around a single theme: both of its code changes repair test impact analysis (TIA), the instrumentation that records which files each test touches and lets Pest select only the tests your edits can affect. If you're on PHP 8.5, the ValueError that aborted any exclusive-lock write during a TIA recording is gone. If you test a Laravel application with a Vue or Svelte frontend, the JavaScript dependency graph — which had been coming back silently empty — now understands single-file components. There are no API, configuration, or workflow changes in this release, so updating is a routine composer update away.

A lock probe that crashed PHP 8.5 runs

When TIA records — the pass that powers features like test selection and type coverage — Pest temporarily replaces the file:// protocol handler with its own ReadCapture stream wrapper. Every filesystem operation still reaches the real stream; Pest simply watches on the side and notes what each test reads.

Userland stream wrappers that want to support flock()-style locking implement a stream_lock() method. The subtlety is that before PHP takes a lock on behalf of a LOCK_EX write, it first asks the wrapper whether locking is supported at all by calling stream_lock(0). Operation 0 is a probe, not a lock request.

ReadCapture::stream_lock() forwarded that 0 straight through to flock() on the real stream. PHP 8.5 no longer tolerates that courtesy reaching the actual lock call, so while TIA recording was active, any test executing file_put_contents(..., LOCK_EX) aborted with a ValueError.

The fix is precise: Pest's wrapper now answers the support probe itself and forwards only genuine lock operations to the underlying stream. If you moved to 5.3.6 on PHP 8.5, this alone is reason enough to bump to 5.3.7.

Single-file components join the JavaScript module graph

The frontend half of TIA lives in a helper that builds a dependency graph over your JavaScript sources, so an edit under resources/js/** can be traced back to the tests that cover the components you touched. That helper already collected .vue and .svelte files as graph entries, then handed them to rolldown to resolve imports. Rolldown, however, has no single-file-component handling: every collected component failed to parse at the first byte of its <script> tag.

Depending on your install, that produced one of two broken outcomes, and neither was good:

  • On a normal install, where rolldown wasn't resolvable, the helper quietly wrote a two-byte {} and exited successfully. The graph was empty, no warning appeared, and no change under resources/js/** ever selected a test.
  • Where rolldown could be resolved, the parse error surfaced instead and the run failed outright.

On a Vue or Svelte project, the available states were effectively "empty graph" or "failed run" — and the silent empty graph was the more dangerous of the two, because nothing told you that frontend-aware test selection had stopped working.

Because the graph only consumes import specifiers, the fix reduces each component to its <script> blocks before rolldown ever sees it. The graph builder now understands .vue and .svelte files natively, so component edits finally map to the tests that exercise them. If you'd written off frontend-aware selection as not working on your project, it's worth re-enabling and giving it another try.

Housekeeping and new contributors

The rest of the release is routine plumbing. The bundled PHPStan constraint was nudged from ^2.3.4 <2.3.6 to ^2.3.5 <2.3.6, the framework version strings were bumped, and the visual help and version snapshots were updated to match. This release also welcomes two first-time Pest contributors: jaspertey, who tracked down the stream lock probe, and atymic, who fixed single-file-component parsing in the module graph. Thanks to both — two targeted fixes landed in one small patch.

Takeaways

  • PHP 8.5 users should upgrade first. Exclusive-lock writes inside tests no longer crash while TIA records.
  • Vue and Svelte projects get working frontend selection. The JS module graph parses single-file components, so changes under resources/js/** select tests again.
  • Nothing to configure. Both fixes are drop-in, with no API or workflow changes.
  • Everything else is maintenance: a PHPStan constraint bump and updated version snapshots.
  • Full changelog: see the v5.3.6...v5.3.7 comparison on GitHub.

Sources

Related Articles