← Back
coverage rails testing tools

Coverage and spring

Today I've looked at my coverage report an I saw a lot of classes marked with 0% coverage, while having tests. Then I read that Simplecov and spring are not good friends.

So I've added a specific package.json script to run tests with coverage (and without spring):

"test:coverage": "rm -rf coverage/ && DISABLE_SPRING=1 COVERAGE=true bundle exec rspec --format documentation",

The optional coverage ENV is at rails_helper.rb:

SimpleCov.start('rails') if ENV['COVERAGE']

🖖