Skip to content

Commit

Permalink
Report when no coverage data is found. Fixes #12
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenLooman committed Feb 21, 2016
1 parent ff08a13 commit 593b33a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/lcov.js
Expand Up @@ -18,7 +18,11 @@ function LCov(runner) {
runner.on('end', function(){
// In a browser context, coverage will be in window.$jscoverage or window._$blanket.
var g = typeof(global) != 'undefined' ? global : window;
var cov = g._$jscoverage || g._$blanket || {};
var cov = g._$jscoverage || g._$blanket;
if (!cov) {
console.error('mocha-lcov-reporter: No coverage data found, make sure your code is properly instrumented');
return;
}

for (var filename in cov) {
var data = cov[filename];
Expand Down

0 comments on commit 593b33a

Please sign in to comment.