Adding colors to PEST on Github actions

After a few months of writing tests using PEST I always wondered why I was seeing tests output with colors on my local but plain white on Github Actions, it felt so bland.

Even having colors=”true” on phpunit.xml didn’t do the trick, every test would return the following:


Luckily, the solution is simple!

You just need to add a simple argument on your .yml when you call
php artisan test, which is –colors=always, ex:

- name: Execute tests
        run: php artisan test --colors=always

This will give an output as follow:

Hopefully you enjoyed this article! My mission is to spread my knowledge, if there is any mistake or room for improvement on this article, just ping me via any of the methods on my about section.

Thanks for reading,
César.


Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *