Code coverage in Pest tells you which lines of code your test suite execute and which lines it doesn’t. Of course, PHPUnit offers you a beautiful section about this topic: Code Coverage Analysis.
Now, in this section, we are going to see the extra options that Pest offers.
--coverage option, gives you a human readable code coverage
directly on the console.
Keep in mind: the percentage displayed concerns the number of lines of source code that has been tested/executed.
Of course, you can always combine the
--min option to configure minimum threshold enforcement
for coverage results. If the thresholds are not met, Pest will return failure.
./vendor/bin/pest --coverage --min=90
Next section: PHPUnit →