playbook
Writing your first Pest test in Laravel
Better code with fewer bugs starts with tests. Write and run your very first Pest test in Laravel.
2u
duration
Ground
pace
Tests are every developer's safety net. They catch mistakes before your users do. Pest is a testing framework for PHP, built on top of PHPUnit but with a simpler, more enjoyable API. In Laravel it is set up so that you can have your first test running within an hour.
You install Pest via Composer, create a test file, and write a short test that checks whether your welcome page loads. Then you run it from the terminal. Green means passed, red means there is work to be done. After that first green bar, you will never look at your code the same way again.
by PlayTryBe team
Install Pest in your Laravel project via Composer with composer require pestphp/pest --dev.
Create a test file in the tests folder and write a simple test that checks whether your welcome page loads with a 200 status.
Suggestion: Use it('loads the welcome page', ...) with an assertStatus(200).Run your test from the terminal with ./vendor/bin/pest. Green means passed, red means there is something to fix.
For anyone copying this