We are doing a gradual replacement of a very old application with Laravel (version 10 for now). We wanted some quick wins of non-essential functionality, and so have written several months of code that never had any tests written for it.
I’m now starting to go back and write tests for this code, but the first thing I did (for “fun”) was to check out Laravel’s code coverage report. It seems to use Pest for this.
It currently runs the 2 example tests Laravel gives you, and then lists our hundred or so classes with a % value next to them — almost always 0% or 100%. (Mostly 0’s, but several 100%’s.)
I’m curious why there are any 100%’s. By what mechanism is this determining that I have tests covered, when there are no tests at all?
Is it possible some of these classes (some enum classes are 0% for instance; others at 100%) are only called by classes minorly overriding/implementing a library’s class or interface? And if it’s being called by a library that is fully tested, it becomes 100%?
Or is there something I’m missing? Thank you!