Skip to content
This repository was archived by the owner on Feb 1, 2022. It is now read-only.

Commit ac269cc

Browse files
committed
Merge pull request #140 from twbs/coverage
code coverage measurement integration
2 parents f94885c + 48a030a commit ac269cc

File tree

7 files changed

+463
-47
lines changed

7 files changed

+463
-47
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ lib-cov
1212

1313
# Coverage directory used by tools like istanbul
1414
coverage
15+
*-cov
1516

1617
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
1718
.grunt

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"./src/cli.js --disable W003,E001 test/fixtures/doctype/missing.html test/fixtures/viewport/missing.html"
2323
],
2424
"after_script": [
25+
"npm run coveralls",
2526
"./test-infra/s3_cache.py upload npm-modules",
2627
"./test-infra/s3_cache.py upload rubygems"
2728
],

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Bootlint
22
[![NPM version](https://badge.fury.io/js/bootlint.svg)](http://badge.fury.io/js/bootlint)
33
[![Build Status](https://travis-ci.org/twbs/bootlint.svg?branch=master)](https://travis-ci.org/twbs/bootlint)
4+
[![Coverage Status](https://img.shields.io/coveralls/twbs/bootlint.svg?branch=master)](https://coveralls.io/r/twbs/bootlint)
45
[![Dependency Status](https://david-dm.org/twbs/bootlint.svg)](https://david-dm.org/twbs/bootlint)
56
[![devDependency Status](https://david-dm.org/twbs/bootlint/dev-status.svg)](https://david-dm.org/twbs/bootlint#info=devDependencies)
67

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
},
2828
"license": "MIT",
2929
"devDependencies": {
30+
"coveralls": "^2.11.2",
3031
"grunt-banner": "^0.2.3",
3132
"grunt-browserify": "^3.0.1",
3233
"grunt-contrib-clean": "^0.6.0",
@@ -38,7 +39,9 @@
3839
"grunt-exec": "^0.4.6",
3940
"grunt-jscs": "^0.7.1",
4041
"jquery": "~2.1.1",
42+
"jscoverage": "^0.5.6",
4143
"load-grunt-tasks": "^0.6.0",
44+
"nodeunit": "^0.9.0",
4245
"npm-shrinkwrap": "^4.0.0",
4346
"time-grunt": "^1.0.0"
4447
},
@@ -63,6 +66,7 @@
6366
"LICENSE"
6467
],
6568
"scripts": {
66-
"test": "grunt test"
69+
"test": "grunt test",
70+
"coveralls": "jscoverage src && BOOTLINT_COV=1 nodeunit --reporter=lcov test | coveralls"
6771
}
6872
}

src/bootlint.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ var semver = require('semver');
167167
var allLinters = {};
168168
function addLinter(id, linter) {
169169
if (allLinters[id]) {
170+
/* @covignore */
170171
throw new Error("Linter already registered with ID: " + id);
171172
}
172173

@@ -178,6 +179,7 @@ var semver = require('semver');
178179
Problem = LintWarning;
179180
}
180181
else {
182+
/* @covignore */
181183
throw new Error("Invalid linter ID: " + id);
182184
}
183185

@@ -214,6 +216,7 @@ var semver = require('semver');
214216
};
215217
}
216218
else {
219+
/* @covignore */
217220
return function lintDoctype($, reporter) {
218221
/*eslint-disable no-undef, block-scoped-var */
219222
var doc = window.document;
@@ -317,6 +320,7 @@ var semver = require('semver');
317320
catch (e) {
318321
// deliberately do nothing
319322
}
323+
/* @covignore */
320324
if (theWindow) {
321325
// check browser global jQuery
322326
var globaljQuery = theWindow.$ || theWindow.jQuery;
@@ -723,6 +727,7 @@ var semver = require('semver');
723727
}
724728
else {
725729
// jQuery; in-browser
730+
/* @covignore */
726731
(function () {
727732
var $ = cheerio;
728733
/**

0 commit comments

Comments
 (0)