New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

petecoop/pest-plugin-watch

A Pest plugin to watch your files and re-run tests on changes.
4,436
Install
composer require petecoop/pest-plugin-watch
Latest Version:5.0.1
PHP:^8.3
License:MIT
Last Updated:Oct 20, 2026
Links: GitHub  ·  Packagist
Maintainer: petecoop

Pest Plugin Watch

A Pest plugin to watch files and restart Pest when they change.

This is a Pest Watch plugin that works with Pest v4 & v5 and differs from the official Pest Watch plugin which became unsupported. It's now built on the spatie/file-system-watcher package which uses the node package chokidar under the hood for efficient file watching.

Installation

You can install the package via composer:

composer require petecoop/pest-plugin-watch --dev

In your project, you should have the JavaScript package chokidar installed. You can install it via npm

npm install chokidar --save-dev

If you are using Bun, you can install it via:

bun a -d chokidar

The watcher will automatically use Bun if there is a bun.lock file in your project.

Usage

To start Pest in watch mode, run the following command:

pest --watch

This will restart Pest whenever a file in src, app, tests or resources/views changes.

You can override the default paths by providing your own paths, for example inside your Pest.php file:

Petecoop\PestWatch\Plugin::directories(['src', 'tests', 'custom-dir']);

Code coverage with Laravel Herd

The watcher preserves the PHP binary and configuration that started it. This allows coverage to be collected on every rerun when using Laravel Herd:

herd coverage vendor/bin/pest --coverage --watch

and allows --tia to work with the watcher:

herd coverage vendor/bin/pest --tia --watch

Related Packages

spatie/pest-plugin-snapshots

A package for snapshot testing in Pest

2,148,919 40
thelemon2020/pest-plugin-pom

A Pest plugin for writing browser tests using the Page Object Model.

81 10
dashworthy/pest-plugin-visualizations

Pest plugin for testing Dashworthy visualizations — DataGrids, Charts, and Metri...

1,176 0
alvarodelera/pest-wp-plugin

Pest plugin for WordPress testing with SQLite support and zero-config setup

1,078 4

Version History

Version Released PHP License
5.0.1 ^8.3 MIT
5.0.0 ^8.3 MIT
0.1.0 ^8.3 MIT