diff --git a/.gitignore b/.gitignore index 0192128693..84548c0138 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,4 @@ package-lock.json yarn-debug.log* .yarn-integrity fetch_config.rb +coverage diff --git a/Gemfile b/Gemfile index 805d371720..ceb33cb016 100644 --- a/Gemfile +++ b/Gemfile @@ -132,4 +132,5 @@ group :test do gem 'capybara-screenshot' gem 'flipper-active_support_cache_store' gem 'webmock' + gem 'simplecov' , require: false end diff --git a/Gemfile.lock b/Gemfile.lock index 5489c44fde..044fddbb8a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -193,6 +193,7 @@ GEM rack-protection (>= 1.5.5) sinatra (>= 1.4.4) diff-lcs (1.4.4) + docile (1.4.0) dotenv (2.7.6) dotenv-rails (2.7.6) dotenv (= 2.7.6) @@ -491,6 +492,12 @@ GEM faraday shoulda-matchers (4.5.1) activesupport (>= 4.2.0) + simplecov (0.21.2) + docile (~> 1.1) + simplecov-html (~> 0.11) + simplecov_json_formatter (~> 0.1) + simplecov-html (0.12.3) + simplecov_json_formatter (0.1.3) sinatra (2.1.0) mustermann (~> 1.0) rack (~> 2.2) @@ -628,6 +635,7 @@ DEPENDENCIES sentry-rails sentry-ruby shoulda-matchers (~> 4.5) + simplecov spring spring-commands-rspec spring-watcher-listen (~> 2.0.0) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index bc3bcfce3d..a666900a0f 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -18,6 +18,20 @@ # it. # # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration + +require "simplecov" +require "simplecov_json_formatter" +SimpleCov.start "rails" do + add_filter "/bin/" + add_filter "/db/" + add_filter "/spec/" + + formatter SimpleCov::Formatter::MultiFormatter.new [ + SimpleCov::Formatter::HTMLFormatter, + SimpleCov::Formatter::JSONFormatter, + ] +end + RSpec.configure do |config| # rspec-expectations config goes here. You can use an alternate # assertion/expectation library such as wrong or the stdlib/minitest