Skip to content
This repository has been archived by the owner on Aug 15, 2018. It is now read-only.

Commit

Permalink
Merge pull request #912 from afc163/master
Browse files Browse the repository at this point in the history
fix coverage culculate error, #911
  • Loading branch information
sorrycc committed Jul 29, 2014
2 parents fe1b623 + 1755f01 commit 1dbae96
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 6 additions & 2 deletions lib/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,12 @@ module.exports = function(config) {
}

mo.getSourceFiles().forEach(function(item) {
if (!path.extname(item)) item = item + '.js';
processCovFile(item);
if (!path.extname(item)) {
item = item + '.js';
}
if (path.extname(item) === '.js') {
processCovFile(item);
}
});

if (coveralls) {
Expand Down
4 changes: 3 additions & 1 deletion lib/theme/templates/mocha-runner.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@
sources = sources.slice(1);
for (var i=0; i<sources.length; i++) {
if (file === sources[i]) {
return url.replace(/\.js$/g, '-cov.js');
if (url.indexOf('handlebars.js') < 0) {
return url.replace(/\.js$/g, '-cov.js');
}
}
}
return url;
Expand Down

0 comments on commit 1dbae96

Please sign in to comment.