I recently started working on a large Rails application. Simplecov says test coverage is above 90%. Very good.
However now and again I discover files that are not even loaded by the test suite. These files are actually used in production but for some reason nobody cared enough to even write the simplest test about them. As a result they are not counted in the coverage metrics.
It worries me since there is an unknown amount of code that is likely to break in prod without us noticing.
Am I the only one to have this problem? Is there a well-known solution? Can we have coverage metrics for files not loaded?
The contributors added new config optiontrack_files
exactly for this purpose. For rails project the value could look like this
track_files '{app,lib}/**/*.rb'
More details here: https://github.com/colszowka/simplecov/pull/422