Skip to content

Commit 8f17552

Browse files
authored
Merge pull request #484 from meilisearch/disable-coverage
Create a way to disable codecoverage
2 parents 80619da + 3337d52 commit 8f17552

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

spec/spec_helper.rb

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,15 @@
1919
# NOTE: If SimpleCov starts after your application code is already loaded (via require),
2020
# it won't be able to track your files and their coverage!
2121
# The SimpleCov.start must be issued before any of your application code is required!
22-
require 'simplecov'
23-
require 'codecov'
2422

25-
SimpleCov.start do
26-
add_filter %r{^/spec/}
27-
formatter SimpleCov::Formatter::Codecov if ENV['CI']
23+
unless ENV.fetch('DISABLE_COVERAGE', false)
24+
require 'simplecov'
25+
require 'codecov'
26+
27+
SimpleCov.start do
28+
add_filter %r{^/spec/}
29+
formatter SimpleCov::Formatter::Codecov if ENV['CI']
30+
end
2831
end
2932

3033
require 'meilisearch'

0 commit comments

Comments
 (0)