Skip to content

Commit 3296c2d

Browse files
committed
Merge pull request #138 from csscomb/tg/test-coverage
Add test coverage report
2 parents 89a7f8a + ae6ce00 commit 3296c2d

31 files changed

+41
-29
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
lib-cov
12
node_modules
3+
test/test-coverage.html
24

35
.idea
46
*.iml

.jscs.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"excludeFiles": [
3-
"node_modules/**"
3+
"node_modules/**",
4+
"lib-cov/**"
45
],
56
"requireCurlyBraces": [
67
"else",

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,14 @@ a
721721
722722
Run `npm test` for tests.
723723
724+
To check test coverage, you need `jscoverage` tool.
725+
Once it is installed ([see instructions here](https://github.com/visionmedia/node-jscoverage#installation)), run:
726+
727+
```
728+
npm run-script test-cov
729+
open ./test/test-coverage.html
730+
```
731+
724732
## Contributing
725733
726734
Anyone and everyone is welcome to contribute. Please take a moment to

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
"csscomb": "./bin/csscomb"
6262
},
6363
"scripts": {
64-
"test": "./node_modules/.bin/jshint-groups && ./node_modules/.bin/jscs . && ./node_modules/.bin/mocha -u bdd -R dot"
64+
"test": "./node_modules/.bin/jshint-groups && ./node_modules/.bin/jscs . && ./node_modules/.bin/mocha -u bdd -R dot",
65+
"test-cov": "rm -rf lib-cov && jscoverage lib lib-cov && TEST_COV=true ./node_modules/.bin/mocha -R html-cov > ./test/test-coverage.html"
6566
}
6667
}

test/always-semicolon-less.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var Comb = require('../lib/csscomb');
1+
var Comb = process.env.TEST_COV ? require('../lib-cov/csscomb') : require('../lib/csscomb');
22
var assert = require('assert');
33
var fs = require('fs');
44

test/always-semicolon-scss.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var Comb = require('../lib/csscomb');
1+
var Comb = process.env.TEST_COV ? require('../lib-cov/csscomb') : require('../lib/csscomb');
22
var assert = require('assert');
33
var fs = require('fs');
44

test/always-semicolon.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var Comb = require('../lib/csscomb');
1+
var Comb = process.env.TEST_COV ? require('../lib-cov/csscomb') : require('../lib/csscomb');
22
var assert = require('assert');
33

44
describe('options/always-semicolon', function() {

test/block-indent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var Comb = require('../lib/csscomb');
1+
var Comb = process.env.TEST_COV ? require('../lib-cov/csscomb') : require('../lib/csscomb');
22
var assert = require('assert');
33

44
describe('options/block-indent', function() {

test/colon-space.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var Comb = require('../lib/csscomb');
1+
var Comb = process.env.TEST_COV ? require('../lib-cov/csscomb') : require('../lib/csscomb');
22
var assert = require('assert');
33

44
describe('options/colon-space', function() {

test/color-case.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var Comb = require('../lib/csscomb');
1+
var Comb = process.env.TEST_COV ? require('../lib-cov/csscomb') : require('../lib/csscomb');
22
var assert = require('assert');
33

44
describe('options/color-case', function() {

0 commit comments

Comments
 (0)