jejacks0n / teaspoon

Teaspoon: Javascript test runner for Rails. Use Selenium, BrowserStack, or PhantomJS.
1.43k stars 243 forks source link

Coverage does not show up with expand_assets set to false #357

Closed mikepack closed 9 years ago

mikepack commented 9 years ago

With config.use_coverage = :default.

Maybe since the spec helper is excluded from coverage, and everything is compiled down, coverage is not being reported?

mikepack commented 9 years ago

Coverage is not recognized because _helper is included in coverage.ignore by default, and application (and everything else) gets required from there.

Instrumentation is still not added because the logic here is not correct. If expand_assets is turned on, instrument=1 is never added to any file. Should probably be something more like:

unless asset && asset.respond_to?(:logical_path)
  return source.blank? ? nil : source
end

if config.expand_assets
  asset.to_a.map { |a| asset_url(a) }
else
  asset_url(asset)
end
mikepack commented 9 years ago

Fixed in 1fdfaae3c8a85d3b65c1895147d5a38ecefd6cdd

andresbravog commented 9 years ago

This is still happening. config.expand_assets = false makes the spec_helper to not be instrumented