DEV Community

Amir Haghi
Amir Haghi

Posted on

Run Laravel test multiple times

If your test fails in some rare cases and you want to see when it fails, you can write a bash script like this for run it over and over.

for i in {1..100}; 
do 
    php artisan test --filter test_something; 
done
Enter fullscreen mode Exit fullscreen mode

It would be better to have this feature built in Laravel but currently I haven't seen it in the docs.

I know it was simple but when we do not code in bash every day, we cant remember its syntax. so consider this like a note to check it when it was required.

Top comments (0)