diff --git a/.gitignore b/.gitignore index 804eafeb..f69b35b0 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ Gemfile.lock pkg/* vendor/ tmp/* +coverage/* diff --git a/Gemfile b/Gemfile index 76d76e3c..9b57bf18 100644 --- a/Gemfile +++ b/Gemfile @@ -12,6 +12,7 @@ gem "rubocop", ">= 1.0" gem "rubocop-shopify", require: false gem "benchmark-ips" gem "dogstatsd-ruby", "~> 5.0", require: false +gem "simplecov", require: false, group: :test platform :mri do # only if Ruby is MRI && >= 3.2 if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.2") diff --git a/test/test_helper.rb b/test/test_helper.rb index 904b98ad..86872905 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -6,6 +6,11 @@ ENV["ENV"] = "test" +if ENV["COVERAGE"] + require "simplecov" + SimpleCov.start +end +# Previous content of test helper now starts here unless ENV.key?("CI") require "minitest/pride" end