Disable SimpleCov if you only run a fraction of your tests

Posted . Visible to the public.

Coverage reports are rarely useful if you run only small parts of your test suite.

Just don't not load SimpleCov in this case, and you will see less noise in your test output:

if RSpec.configuration.files_to_run.count > 5
  require "simplecov"
  SimpleCov.start 'rails'
end

See also

Michael Leimstädtner
Last edit
Michael Leimstädtner
License
Source code in this card is licensed under the MIT License.
Posted by Michael Leimstädtner to makandra dev (2025-09-01 08:43)