PHPackages                             lonnylot/dusk-watcher - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. lonnylot/dusk-watcher

ActiveLibrary[Testing &amp; Quality](/categories/testing)

lonnylot/dusk-watcher
=====================

Automatically rerun Laravel Dusk tests when source code changes

10.0.1(7y ago)0460MITPHPPHP ^7.0

Since Jul 28Pushed 7y ago1 watchersCompare

[ Source](https://github.com/lonnylot/phpunit-watcher)[ Packagist](https://packagist.org/packages/lonnylot/dusk-watcher)[ Docs](https://github.com/lonnylot/phpunit-watcher/tree/dusk)[ RSS](/packages/lonnylot-dusk-watcher/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (7)Versions (27)Used By (0)

Automatically rerun PHPUnit tests when source code changes
==========================================================

[](#automatically-rerun-phpunit-tests-when-source-code-changes)

[![Latest Version on Packagist](https://camo.githubusercontent.com/321b874acaeeabbd431c399082e332e53d801a281f8225425c8a92129b0f79e5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7370617469652f706870756e69742d776174636865722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/phpunit-watcher)[![Build Status](https://camo.githubusercontent.com/05d8f67adf5b09c809ef5715074307fe9c645f5f2f13a7e9c906b36ed3ae9a73/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7370617469652f706870756e69742d776174636865722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/spatie/phpunit-watcher)[![SensioLabsInsight](https://camo.githubusercontent.com/93afabe4c90979c486774e7eca9d6699b60a45d91d780293aa25566604243180/68747470733a2f2f696d672e736869656c64732e696f2f73656e73696f6c6162732f692f37623662353735622d383162312d346661632d383236612d3932353764343663356336632e7376673f7374796c653d666c61742d737175617265)](https://insight.sensiolabs.com/projects/7b6b575b-81b1-4fac-826a-9257d46c5c6c)[![Quality Score](https://camo.githubusercontent.com/77c719685c8a440d63bcb3f91b7bbb0dbed3334cad4638d5c633061018ab9851/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f7370617469652f706870756e69742d776174636865722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/spatie/phpunit-watcher)[![StyleCI](https://camo.githubusercontent.com/24e9e9ba37d5db319b2cf72ce2eb3138a7eca648938e81222f327027e7e213cc/68747470733a2f2f7374796c6563692e696f2f7265706f732f39383136333932332f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/98163923)[![Total Downloads](https://camo.githubusercontent.com/652fc81022db1f0764559fb258b35b2aaae5288e9f182479d05548a0d48bd618/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7370617469652f706870756e69742d776174636865722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/phpunit-watcher)

Wouldn't it be great if your PHPUnit tests would be automatically rerun whenever you change some code? This package can do exactly that.

With the package installed you can do this:

```
phpunit-watcher watch
```

Here's how it looks like:

[![watcher screenshot](https://camo.githubusercontent.com/923db66d25206b2e35c31fd1d08178e6e5d024e70dbe46bf96401d0411dacc62/68747470733a2f2f7370617469652e6769746875622e696f2f706870756e69742d776174636865722f73637265656e73686f74732f776174636865722e6a7067)](https://camo.githubusercontent.com/923db66d25206b2e35c31fd1d08178e6e5d024e70dbe46bf96401d0411dacc62/68747470733a2f2f7370617469652e6769746875622e696f2f706870756e69742d776174636865722f73637265656e73686f74732f776174636865722e6a7067)

This will run the tests and rerun them whenever a file in the `app`, `src` or `tests` directory is modified.

Want to pass some arguments to PHPUnit? No problem, just tack them on:

```
phpunit-watcher watch --filter=it_can_run_a_single_test
```

In his excellent talk at Laracon EU 2017 [Amo Chohan](https://github.com/amochohan) shows our phpunit-watcher in action.

[![Amo Chohan demo](https://camo.githubusercontent.com/a6934b2434394f655e4c266e3b799e463b779c9b9486dc1f1dcf22dca0c7fb91/68747470733a2f2f7370617469652e6769746875622e696f2f706870756e69742d776174636865722f766964656f7468756d622e706e67)](https://youtu.be/CF1UhUj9LG0?t=26m13s)

Installation
------------

[](#installation)

You can install this package globally like this

```
composer global require spatie/phpunit-watcher
```

After that `phpunit-watcher watch` can be run in any directory on your system.

Alternatively you can install the package locally as a dev dependency in your project

```
composer require spatie/phpunit-watcher --dev
```

Locally installed you can run it with `vendor/bin/phpunit-watcher watch`

Usage
-----

[](#usage)

All the examples assume you've installed the package globally. If you opted for the local installation prepend `vendor/bin/` everywhere where `phpunit-watcher` is mentioned.

You can start the watcher with:

```
phpunit-watcher watch
```

This will run the tests and rerun them whenever a file in the `src` or `tests` directory is modified.

Want to pass some arguments to PHPUnit? No problem, just tack them on:

```
phpunit-watcher watch --filter=it_can_run_a_single_test
```

Customization
-------------

[](#customization)

Certain aspects of the behaviour of the tool can be modified. All options can be set in a `.phpunit-watcher.yml` in your project directory.

If a such a config file does not exist in the project directory, the tool will check if the file exists in any of the parent directories of the project directory.

Here's some example content. Read on for a more detailed explanation of all the options.

```
watch:
  directories:
    - src
    - tests
  fileMask: '*.php'
notifications:
  passingTests: false
  failingTests: false
phpunit:
  arguments: '--stop-on-failure'
```

### Customize watched directories and files

[](#customize-watched-directories-and-files)

You can customize the directories being watched by creating a file named `.phpunit-watcher.yml` in your project directory. Here's some example content:

```
watch:
  directories:
    - src
    - tests
  fileMask: '*.php'
```

### Desktop notifications

[](#desktop-notifications)

By default the tool will display desktop notifications whenever the tests pass or fail. If you want to disable certain desktop notifications update `.phpunit-watcher.yml` by adding a `notifications` key.

```
notifications:
  passingTests: false
  failingTests: false
```

### Initial PHPUnit arguments

[](#initial-phpunit-arguments)

If you want to use pass the same arguments to PHPUnit everytime to watcher starts, you can specificy those in the `.phpunit-watcher.yml` config file. Here's an example:

```
phpunit:
  arguments: '--stop-on-failure'
```

When starting the tool with some arguments (eg `phpunit-watcher watch --filter=my_favourite_test`) those arguments will get used instead of the ones specified in the config file.

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Testing
-------

[](#testing)

```
composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Postcardware
------------

[](#postcardware)

You're free to use this package (it's [MIT-licensed](LICENSE.md)), but if you use it often we highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using.

Our address is: Spatie, Samberstraat 69D, 2060 Antwerp, Belgium.

We publish all received postcards [on our company website](https://spatie.be/en/opensource/postcards).

Credits
-------

[](#credits)

- [Freek Van der Herten](https://github.com/freekmurze)
- [All Contributors](../../contributors)

We started creating this package after reading [this excellent article](https://www.sitepoint.com/write-javascript-style-test-watchers-php/) by [Christoper Pitt](https://twitter.com/assertchris)

Interactive commands were inspired by [Jest](https://facebook.github.io/jest/).

Support us
----------

[](#support-us)

Spatie is a webdesign agency based in Antwerp, Belgium. You'll find an overview of all our open source projects [on our website](https://spatie.be/opensource).

Does your business depend on our contributions? Reach out and support us on [Patreon](https://www.patreon.com/spatie). All pledges will be dedicated to allocating workforce on maintenance and new awesome stuff.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 84.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~13 days

Recently: every ~25 days

Total

25

Last Release

2896d ago

Major Versions

0.0.2 → 1.0.02017-07-31

1.5.1 → 10.0.02018-06-07

### Community

Maintainers

![](https://www.gravatar.com/avatar/64b21af385cbc107515398b5087e1dc0de97c7cfa3a9a02034a46c9b9979a3c2?d=identicon)[lonnylot](/maintainers/lonnylot)

---

Top Contributors

[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (91 commits)")[![casperboone](https://avatars.githubusercontent.com/u/15815208?v=4)](https://github.com/casperboone "casperboone (3 commits)")[![lonnylot](https://avatars.githubusercontent.com/u/656791?v=4)](https://github.com/lonnylot "lonnylot (3 commits)")[![mikeerickson](https://avatars.githubusercontent.com/u/183153?v=4)](https://github.com/mikeerickson "mikeerickson (2 commits)")[![ntwb](https://avatars.githubusercontent.com/u/1016458?v=4)](https://github.com/ntwb "ntwb (2 commits)")[![svenluijten](https://avatars.githubusercontent.com/u/11269635?v=4)](https://github.com/svenluijten "svenluijten (1 commits)")[![akoepcke](https://avatars.githubusercontent.com/u/5311185?v=4)](https://github.com/akoepcke "akoepcke (1 commits)")[![vyuldashev](https://avatars.githubusercontent.com/u/1809081?v=4)](https://github.com/vyuldashev "vyuldashev (1 commits)")[![bencarrr](https://avatars.githubusercontent.com/u/8208631?v=4)](https://github.com/bencarrr "bencarrr (1 commits)")[![brendt](https://avatars.githubusercontent.com/u/6905297?v=4)](https://github.com/brendt "brendt (1 commits)")[![cameroncox](https://avatars.githubusercontent.com/u/1105?v=4)](https://github.com/cameroncox "cameroncox (1 commits)")[![raphaelstolt](https://avatars.githubusercontent.com/u/48225?v=4)](https://github.com/raphaelstolt "raphaelstolt (1 commits)")

---

Tags

spatiedusk-watcher

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/lonnylot-dusk-watcher/health.svg)

```
[![Health](https://phpackages.com/badges/lonnylot-dusk-watcher/health.svg)](https://phpackages.com/packages/lonnylot-dusk-watcher)
```

###  Alternatives

[spatie/phpunit-watcher

Automatically rerun PHPUnit tests when source code changes

8839.2M475](/packages/spatie-phpunit-watcher)[behat/behat

Scenario-oriented BDD framework for PHP

4.0k96.8M2.0k](/packages/behat-behat)[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.1k](/packages/orchestra-testbench)[infection/infection

Infection is a Mutation Testing framework for PHP. The mutation adequacy score can be used to measure the effectiveness of a test set in terms of its ability to detect faults.

2.2k26.2M1.8k](/packages/infection-infection)[phpbench/phpbench

PHP Benchmarking Framework

2.0k13.0M627](/packages/phpbench-phpbench)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
