DEV: Better SimpleCov configuration (#12544)

It makes SimpleCov work with turbo_rspec and uses the default Rails
configuration (with some changes) to groups files by their type
(models, controllers, etc).
This commit is contained in:
Dan Ungureanu 2021-03-29 21:01:35 +03:00 committed by GitHub
parent 330c831ba4
commit c89f97aafe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -2,7 +2,14 @@
if ENV['COVERAGE'] if ENV['COVERAGE']
require 'simplecov' require 'simplecov'
SimpleCov.start SimpleCov.command_name "#{SimpleCov.command_name} #{ENV['TEST_ENV_NUMBER']}" if ENV['TEST_ENV_NUMBER']
SimpleCov.start 'rails' do
add_group 'Libraries', /^\/lib\/(?!tasks).*$/
add_group 'Scripts', 'script'
add_group 'Serializers', 'app/serializers'
add_group 'Services', 'app/services'
add_group 'Tasks', 'lib/tasks'
end
end end
require 'rubygems' require 'rubygems'