21

I just want to exclude the vendor gems from being shown with the coverage report, how to do that?

Here is how my coverage report looks like:

Report

Wazery
  • 15,394
  • 19
  • 63
  • 95

2 Answers2

21

You can exclude the vendors folder adding a filter in the spec_helper.rb or where you define the configuration for SimpleCov

SimpleCov.start 'rails' do
  add_filter 'vendor'
end
  • Adding such a `.simplecov` file at the root of your project directory also allows `bashcov` to ignore those directories/files. – a.t. Dec 24 '22 at 16:39
19

Here is how I handled it, figured out with their documentation!

SimpleCov.profiles.define 'no_vendor_coverage' do
  load_profile 'rails'
  add_filter 'vendor' # Don't include vendored stuff
end

SimpleCov.start 'no_vendor_coverage'
Dylan Pierce
  • 4,313
  • 3
  • 35
  • 45
Wazery
  • 15,394
  • 19
  • 63
  • 95