Skip to content

Commit e4813ee

Browse files
bors[bot]jmks
andauthored
Merge #247
247: Fix simplecov r=curquiza a=jmks I was looking at the coverage stats, and noticed that Simplecov appears to be misconfigured. It only showed coverage for spec files. I reordered the `require`s and added a note (from the SimpleCov repo) on why it is configured that way. Additionally, I filtered out the spec files from the coverage report. Here's screenshots before: ![Screen Shot 2021-10-20 at 9 43 36 AM](https://user-images.githubusercontent.com/4923990/138110072-a0194344-dcf1-47ba-a81d-bd02f88516e7.png) and after: <img width="791" alt="Screen Shot 2021-10-20 at 9 52 34 AM" src="https://user-images.githubusercontent.com/4923990/138110073-4f03fa93-6a51-4f02-b971-81cfdd764558.png"> Co-authored-by: Jason Schweier <[email protected]>
2 parents 05fcbfa + 9b92f79 commit e4813ee

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

spec/spec_helper.rb

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,16 @@
1616
#
1717
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
1818

19-
require 'meilisearch'
20-
require 'byebug'
19+
# NOTE: If SimpleCov starts after your application code is already loaded (via require),
20+
# it won't be able to track your files and their coverage!
21+
# The SimpleCov.start must be issued before any of your application code is required!
2122
require 'simplecov'
23+
SimpleCov.start do
24+
add_filter %r{^/spec/}
25+
end
2226

23-
SimpleCov.start
27+
require 'meilisearch'
28+
require 'byebug'
2429

2530
# Globals for all tests
2631
URL = 'http://localhost:7700'

0 commit comments

Comments
 (0)