Skip to content

Commit

Permalink
Merge branch 'master' of github.com:hapijs/lab
Browse files Browse the repository at this point in the history
Merge
  • Loading branch information
geek committed Aug 15, 2016
2 parents c37b43b + 362fc39 commit 8e4bdba
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
6 changes: 5 additions & 1 deletion lib/coverage.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,11 @@ internals.instrument = function (filename) {

// Coverage status

if (bypass[node.range[0]] && bypass[node.range[1]]) {
const bypassTests = [];
for (let i = node.range[0]; i <= node.range[1]; ++i) {
bypassTests.push(bypass[i]);
}
if (bypassTests.every((test) => test)) {
return;
}

Expand Down
4 changes: 2 additions & 2 deletions test/coverage.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,9 @@ describe('Coverage', () => {

const cov = Lab.coverage.analyze({ coveragePath: Path.join(__dirname, 'coverage/bypass-misses') });
expect(Math.floor(cov.percent)).to.equal(93);
expect(cov.sloc).to.equal(15);
expect(cov.sloc).to.equal(16);
expect(cov.misses).to.equal(1);
expect(cov.hits).to.equal(14);
expect(cov.hits).to.equal(15);
done();
});

Expand Down
3 changes: 2 additions & 1 deletion test/coverage/bypass-misses.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ const /*$lab:coverage:on$*/FiveMath = function () {
this.subtractFive = function (value) {

return value - 5;
};
};/*$lab:coverage:off$*/
};
/*$lab:coverage:on$*/

const fiveMath = new FiveMath();

Expand Down

0 comments on commit 8e4bdba

Please sign in to comment.