devpt-org / site

devPT Site
4 stars 7 forks source link

[TESTS] Install Pest PHP, migrate tests and add GitHub Actions #19

Closed dansysanalyst closed 1 year ago

dansysanalyst commented 1 year ago

 🚩 TL;DR: Install Pest PHP, migrate tests and and add GitHub Actions.

Hello everybody,

🇵🇹/🇬🇧 Even though this repository is aimed at the Portuguese community, I'm writing in English in case non-Portuguese speakers this content PR useful.

This PR introduces Pest PHP as the test framework.

👨🏻‍💻 Motivation

It was mentioned in the last YouTube Live the intention to adopt Pest as the test framework, I've decided to go ahead installing Pest and converting the LinksControllerTest. I have also introduced a GitHub Action to run tests on Push and Pull Request.

❗ Important Changes

📌 I've disabled Vite resolving assets during tests, more information at Laravel doc.

📌 I have defined some Custom Helpers to access the Factories in a clean way and to act as user.

📌 A new test was added to make sure guests cannot access the links page.


Please let me know if there are any changes required.

Greetings and thanks,

Dan