2017 © Pedro Peláez
 

library dusk-watcher

Automatically rerun Laravel Dusk tests when source code changes

image

lonnylot/dusk-watcher

Automatically rerun Laravel Dusk tests when source code changes

  • Thursday, June 7, 2018
  • by lonnylot
  • Repository
  • 1 Watchers
  • 0 Stars
  • 5 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 20 Forks
  • 0 Open issues
  • 27 Versions
  • 0 % Grown

The README.md

Automatically rerun PHPUnit tests when source code changes

Latest Version on Packagist Build Status SensioLabsInsight Quality Score StyleCI Total Downloads, (*1)

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

With the package installed you can do this:, (*3)

phpunit-watcher watch

Here's how it looks like:, (*4)

watcher screenshot, (*5)

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

Want to pass some arguments to PHPUnit? No problem, just tack them on:, (*7)

phpunit-watcher watch --filter=it_can_run_a_single_test

In his excellent talk at Laracon EU 2017 Amo Chohan shows our phpunit-watcher in action., (*8)

Amo Chohan demo, (*9)

Installation

You can install this package globally like this, (*10)

composer global require spatie/phpunit-watcher

After that phpunit-watcher watch can be run in any directory on your system., (*11)

Alternatively you can install the package locally as a dev dependency in your project, (*12)

composer require spatie/phpunit-watcher --dev

Locally installed you can run it with vendor/bin/phpunit-watcher watch, (*13)

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., (*14)

You can start the watcher with:, (*15)

phpunit-watcher watch

This will run the tests and rerun them whenever a file in the src or tests directory is modified., (*16)

Want to pass some arguments to PHPUnit? No problem, just tack them on:, (*17)

phpunit-watcher watch --filter=it_can_run_a_single_test

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., (*18)

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., (*19)

Here's some example content. Read on for a more detailed explanation of all the options., (*20)

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

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:, (*21)

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

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., (*22)

notifications:
  passingTests: false
  failingTests: false

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:, (*23)

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., (*24)

Changelog

Please see CHANGELOG for more information what has changed recently., (*25)

Testing

bash composer test, (*26)

Contributing

Please see CONTRIBUTING for details., (*27)

Security

If you discover any security related issues, please email freek@spatie.be instead of using the issue tracker., (*28)

Postcardware

You're free to use this package (it's MIT-licensed), 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., (*29)

Our address is: Spatie, Samberstraat 69D, 2060 Antwerp, Belgium., (*30)

We publish all received postcards on our company website., (*31)

Credits

We started creating this package after reading this excellent article by Christoper Pitt, (*32)

Interactive commands were inspired by Jest., (*33)

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., (*34)

Does your business depend on our contributions? Reach out and support us on Patreon. All pledges will be dedicated to allocating workforce on maintenance and new awesome stuff., (*35)

License

The MIT License (MIT). Please see License File for more information., (*36)

The Versions

29/08 2017
29/08 2017
23/08 2017
09/08 2017
05/08 2017
05/08 2017
05/08 2017
05/08 2017

1.2.1

1.2.1.0 https://github.com/spatie/phpunit-watcher

Automatically rerun PHPUnit tests when source code changes

  Sources   Download

MIT

The Requires

 

The Development Requires

spatie phpunit-watcher

05/08 2017

1.2.0

1.2.0.0 https://github.com/spatie/phpunit-watcher

Automatically rerun PHPUnit tests when source code changes

  Sources   Download

MIT

The Requires

 

The Development Requires

spatie phpunit-watcher

02/08 2017

1.1.0

1.1.0.0 https://github.com/spatie/phpunit-watcher

Automatically rerun PHPUnit tests when source code changes

  Sources   Download

MIT

The Requires

 

The Development Requires

spatie phpunit-watcher

01/08 2017

1.0.4

1.0.4.0 https://github.com/spatie/phpunit-watcher

Automatically rerun PHPUnit tests when source code changes

  Sources   Download

MIT

The Requires

 

The Development Requires

spatie phpunit-watcher

01/08 2017

1.0.3

1.0.3.0 https://github.com/spatie/phpunit-watcher

Automatically rerun PHPUnit tests when source code changes

  Sources   Download

MIT

The Requires

 

The Development Requires

spatie phpunit-watcher

31/07 2017

1.0.2

1.0.2.0 https://github.com/spatie/phpunit-watcher

Automatically rerun PHPUnit tests when source code changes

  Sources   Download

MIT

The Requires

 

The Development Requires

spatie phpunit-watcher

31/07 2017

1.0.1

1.0.1.0 https://github.com/spatie/phpunit-watcher

Automatically rerun PHPUnit tests when source code changes

  Sources   Download

MIT

The Requires

 

The Development Requires

spatie phpunit-watcher

31/07 2017

1.0.0

1.0.0.0 https://github.com/spatie/phpunit-watcher

Automatically rerun PHPUnit tests when source code changes

  Sources   Download

MIT

The Requires

 

The Development Requires

spatie phpunit-watcher

28/07 2017

0.0.2

0.0.2.0 https://github.com/spatie/phpunit-watcher

Automatically rerun PHPUnit tests when source code changes

  Sources   Download

MIT

The Requires

 

The Development Requires

spatie phpunit-watcher

28/07 2017

0.0.1

0.0.1.0 https://github.com/spatie/phpunit-watcher

Automatically rerun PHPUnit tests when source code changes

  Sources   Download

MIT

The Requires

 

The Development Requires

spatie phpunit-watcher