Coverage output path ignored in 1.2.0
ukdave opened this issue · 3 comments
ukdave commented
I just upgraded teaspoon from 1.1.5 to 1.2.0 and noticed that the HTML coverage report is no longer generated in the directory that I have configured.
My configuration in teaspoon_env.rb
looks like this:
Teaspoon.configure do |config|
# ...
config.use_coverage = true
config.coverage do |coverage|
coverage.reports = %w[text-summary html]
coverage.output_path = "log/coverage/js"
coverage.ignore = [
%r{/lib/ruby/gems/},
%r{/vendor/*},
%r{/support/},
%r{/(.+)_helper.},
%r{/assets/javascripts/plugin_config},
]
coverage.statements = 100
coverage.functions = 100
coverage.branches = 100
coverage.lines = 100
end
# ...
end
After updating to 1.2.0 the coverage report is generated in coverage
instead of log/coverage/js
.
I've had a look through the source code and I believe the issue is in how the arguments are passed to istanbul in the generate_report
method of lib/teaspoon/coverage.rb
:
Open3.capture2e(
@executable, "report", "--include=#{input.shellescape}", "--dir #{output_path}", format
)
should be:
Open3.capture2e(
@executable, "report", "--include=#{input.shellescape}", "--dir", output_path, format
)
mathieujobin commented
I merged #579
thank you