pest icon indicating copy to clipboard operation
pest copied to clipboard

We need to implement a -t watch like ts/bun.

Open phpmac opened this issue 10 months ago • 8 comments

Automatic hot reloading and unit testing are quite useful for frequently modifying and debugging code. I hope to expand this feature.

phpmac avatar Mar 25 '25 14:03 phpmac

@phpmac Are you saying about the --watch option when run the tests?

./vendor/bin/pest --watch
./vendor/bin/pest path/file.php --watch

It's already exists.

carlossantosdev avatar Apr 08 '25 19:04 carlossantosdev

--watch

no ,

   INFO  Unknown option "--watch".

phpmac avatar Apr 09 '25 07:04 phpmac

name     : pestphp/pest
descrip. : The elegant PHP Testing Framework.
keywords : framework, pest, php, test, testing, unit
versions : * v3.8.1
released : 2025-04-03, this week
type     : library
license  : MIT License (MIT) (OSI approved) https://spdx.org/licenses/MIT.html#licenseText
homepage : 
source   : [git] https://github.com/pestphp/pest.git 6080f51a0b0830715c48ba0e7458b06907febfe5
dist     : [zip] https://api.github.com/repos/pestphp/pest/zipball/6080f51a0b0830715c48ba0e7458b06907febfe5 6080f51a0b0830715c48ba0e7458b06907febfe5
path     : /Users/a/Downloads/laravel/vendor/pestphp/pest
names    : pestphp/pest

support
issues : https://github.com/pestphp/pest/issues
source : https://github.com/pestphp/pest/tree/v3.8.1

autoload
files
psr-4
Pest\ => src/

requires
brianium/paratest ^7.8.3
nunomaduro/collision ^8.8.0
nunomaduro/termwind ^2.3.0
pestphp/pest-plugin ^3.0.0
pestphp/pest-plugin-arch ^3.1.0
pestphp/pest-plugin-mutate ^3.0.5
php ^8.2.0
phpunit/phpunit ^11.5.15

requires (dev)
pestphp/pest-dev-tools ^3.4.0
pestphp/pest-plugin-type-coverage ^3.5.0
symfony/process ^7.2.5

conflicts
filp/whoops <2.16.0
phpunit/phpunit >11.5.15
sebastian/exporter <6.0.0
webmozart/assert <1.11.0

phpmac avatar Apr 09 '25 07:04 phpmac

@phpmac, it's a separate plugin (not part of core). https://pestphp.com/docs/plugins#watch

For reference, it depends on fswatch

owenvoke avatar Apr 09 '25 08:04 owenvoke

Your answer surprised me.

@phpmac,它是一个单独的插件(不是核心的一部分)。 https://pestphp.com/docs/plugins#watch

作为参考,它取决于 fswatch

phpmac avatar Apr 09 '25 08:04 phpmac

With the watcher, is it possible to use it so that it only re-runs relevant tests and not the whole suite.

dimitriadamou avatar Jul 02 '25 23:07 dimitriadamou

@dimitriadamou, you should be able to use any additional flags such as --filter when using the Watch plugin as far as I know.

owenvoke avatar Jul 03 '25 07:07 owenvoke

Unfortunately the Watch plugin is deprecated and archived. Version 3 of the Watch plugin is incompatible with Pest 4.

We need first-class support for a --watch flag in Pest. Anyone doing test-driven development does not want to switch to their terminal and run pest again manually after every code change. It's wild to me that this was removed.

paulshryock avatar Sep 09 '25 21:09 paulshryock