Skip to content

Commit

Permalink
Add test coverage report
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyganch committed Dec 26, 2013
1 parent 89a7f8a commit ae6ce00
Show file tree
Hide file tree
Showing 31 changed files with 41 additions and 29 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
lib-cov
node_modules
test/test-coverage.html

.idea
*.iml
Expand Down
3 changes: 2 additions & 1 deletion .jscs.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"excludeFiles": [
"node_modules/**"
"node_modules/**",
"lib-cov/**"
],
"requireCurlyBraces": [
"else",
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,14 @@ a
Run `npm test` for tests.
To check test coverage, you need `jscoverage` tool.
Once it is installed ([see instructions here](https://github.com/visionmedia/node-jscoverage#installation)), run:
```
npm run-script test-cov
open ./test/test-coverage.html
```
## Contributing
Anyone and everyone is welcome to contribute. Please take a moment to
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
"csscomb": "./bin/csscomb"
},
"scripts": {
"test": "./node_modules/.bin/jshint-groups && ./node_modules/.bin/jscs . && ./node_modules/.bin/mocha -u bdd -R dot"
"test": "./node_modules/.bin/jshint-groups && ./node_modules/.bin/jscs . && ./node_modules/.bin/mocha -u bdd -R dot",
"test-cov": "rm -rf lib-cov && jscoverage lib lib-cov && TEST_COV=true ./node_modules/.bin/mocha -R html-cov > ./test/test-coverage.html"
}
}
2 changes: 1 addition & 1 deletion test/always-semicolon-less.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var Comb = require('../lib/csscomb');
var Comb = process.env.TEST_COV ? require('../lib-cov/csscomb') : require('../lib/csscomb');
var assert = require('assert');
var fs = require('fs');

Expand Down
2 changes: 1 addition & 1 deletion test/always-semicolon-scss.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var Comb = require('../lib/csscomb');
var Comb = process.env.TEST_COV ? require('../lib-cov/csscomb') : require('../lib/csscomb');
var assert = require('assert');
var fs = require('fs');

Expand Down
2 changes: 1 addition & 1 deletion test/always-semicolon.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var Comb = require('../lib/csscomb');
var Comb = process.env.TEST_COV ? require('../lib-cov/csscomb') : require('../lib/csscomb');
var assert = require('assert');

describe('options/always-semicolon', function() {
Expand Down
2 changes: 1 addition & 1 deletion test/block-indent.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var Comb = require('../lib/csscomb');
var Comb = process.env.TEST_COV ? require('../lib-cov/csscomb') : require('../lib/csscomb');
var assert = require('assert');

describe('options/block-indent', function() {
Expand Down
2 changes: 1 addition & 1 deletion test/colon-space.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var Comb = require('../lib/csscomb');
var Comb = process.env.TEST_COV ? require('../lib-cov/csscomb') : require('../lib/csscomb');
var assert = require('assert');

describe('options/colon-space', function() {
Expand Down
2 changes: 1 addition & 1 deletion test/color-case.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var Comb = require('../lib/csscomb');
var Comb = process.env.TEST_COV ? require('../lib-cov/csscomb') : require('../lib/csscomb');
var assert = require('assert');

describe('options/color-case', function() {
Expand Down
2 changes: 1 addition & 1 deletion test/color-shorthand.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var Comb = require('../lib/csscomb');
var Comb = process.env.TEST_COV ? require('../lib-cov/csscomb') : require('../lib/csscomb');
var assert = require('assert');

describe('options/color-shorthand', function() {
Expand Down
2 changes: 1 addition & 1 deletion test/combinator-space.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var Comb = require('../lib/csscomb');
var Comb = process.env.TEST_COV ? require('../lib-cov/csscomb') : require('../lib/csscomb');
var assert = require('assert');

describe('options/combinator-space', function() {
Expand Down
2 changes: 1 addition & 1 deletion test/configure.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var Comb = require('../lib/csscomb');
var Comb = process.env.TEST_COV ? require('../lib-cov/csscomb') : require('../lib/csscomb');
var assert = require('assert');

describe('csscomb methods', function() {
Expand Down
2 changes: 1 addition & 1 deletion test/csscomb.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var Comb = require('../lib/csscomb');
var Comb = process.env.TEST_COV ? require('../lib-cov/csscomb') : require('../lib/csscomb');
var assert = require('assert');

describe('csscomb methods', function() {
Expand Down
2 changes: 1 addition & 1 deletion test/element-case.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var Comb = require('../lib/csscomb');
var Comb = process.env.TEST_COV ? require('../lib-cov/csscomb') : require('../lib/csscomb');
var assert = require('assert');

describe('options/element-case', function() {
Expand Down
2 changes: 1 addition & 1 deletion test/eof-newline.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var Comb = require('../lib/csscomb');
var Comb = process.env.TEST_COV ? require('../lib-cov/csscomb') : require('../lib/csscomb');
var assert = require('assert');

describe('options/eof-newline', function() {
Expand Down
2 changes: 1 addition & 1 deletion test/get-config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var Comb = require('../lib/csscomb');
var Comb = process.env.TEST_COV ? require('../lib-cov/csscomb') : require('../lib/csscomb');
var assert = require('assert');

describe('csscomb methods', function() {
Expand Down
2 changes: 1 addition & 1 deletion test/integral.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var Comb = require('../lib/csscomb');
var Comb = process.env.TEST_COV ? require('../lib-cov/csscomb') : require('../lib/csscomb');
var assert = require('assert');
var vow = require('vow');
var vfs = require('vow-fs');
Expand Down
2 changes: 1 addition & 1 deletion test/leading-zero.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var Comb = require('../lib/csscomb');
var Comb = process.env.TEST_COV ? require('../lib-cov/csscomb') : require('../lib/csscomb');
var assert = require('assert');

describe('options/leading-zero', function() {
Expand Down
2 changes: 1 addition & 1 deletion test/less.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var Comb = require('../lib/csscomb');
var Comb = process.env.TEST_COV ? require('../lib-cov/csscomb') : require('../lib/csscomb');
var assert = require('assert');
var fs = require('fs');

Expand Down
2 changes: 1 addition & 1 deletion test/quotes.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var Comb = require('../lib/csscomb');
var Comb = process.env.TEST_COV ? require('../lib-cov/csscomb') : require('../lib/csscomb');
var assert = require('assert');

describe('options/quotes', function() {
Expand Down
2 changes: 1 addition & 1 deletion test/remove-empty-rulesets.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var Comb = require('../lib/csscomb');
var Comb = process.env.TEST_COV ? require('../lib-cov/csscomb') : require('../lib/csscomb');
var assert = require('assert');

describe('options/remove-empty-rulesets', function() {
Expand Down
2 changes: 1 addition & 1 deletion test/rule-indent.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var Comb = require('../lib/csscomb');
var Comb = process.env.TEST_COV ? require('../lib-cov/csscomb') : require('../lib/csscomb');
var assert = require('assert');

describe('options/rule-indent', function() {
Expand Down
2 changes: 1 addition & 1 deletion test/scss.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var Comb = require('../lib/csscomb');
var Comb = process.env.TEST_COV ? require('../lib-cov/csscomb') : require('../lib/csscomb');
var assert = require('assert');
var fs = require('fs');

Expand Down
2 changes: 1 addition & 1 deletion test/sort-order-less.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var Comb = require('../lib/csscomb');
var Comb = process.env.TEST_COV ? require('../lib-cov/csscomb') : require('../lib/csscomb');
var assert = require('assert');
var fs = require('fs');

Expand Down
2 changes: 1 addition & 1 deletion test/sort-order-scss.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var Comb = require('../lib/csscomb');
var Comb = process.env.TEST_COV ? require('../lib-cov/csscomb') : require('../lib/csscomb');
var assert = require('assert');
var fs = require('fs');

Expand Down
2 changes: 1 addition & 1 deletion test/sort-order.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var Comb = require('../lib/csscomb');
var Comb = process.env.TEST_COV ? require('../lib-cov/csscomb') : require('../lib/csscomb');
var assert = require('assert');
var fs = require('fs');

Expand Down
2 changes: 1 addition & 1 deletion test/stick-brace.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var Comb = require('../lib/csscomb');
var Comb = process.env.TEST_COV ? require('../lib-cov/csscomb') : require('../lib/csscomb');
var assert = require('assert');

describe('options/stick-brace', function() {
Expand Down
2 changes: 1 addition & 1 deletion test/strip-spaces.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var Comb = require('../lib/csscomb');
var Comb = process.env.TEST_COV ? require('../lib-cov/csscomb') : require('../lib/csscomb');
var assert = require('assert');

describe('options/strip-spaces', function() {
Expand Down
2 changes: 1 addition & 1 deletion test/unitless-zero.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var Comb = require('../lib/csscomb');
var Comb = process.env.TEST_COV ? require('../lib-cov/csscomb') : require('../lib/csscomb');
var assert = require('assert');

describe('options/unitless-zero', function() {
Expand Down
2 changes: 1 addition & 1 deletion test/vendor-prefix-align.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var Comb = require('../lib/csscomb');
var Comb = process.env.TEST_COV ? require('../lib-cov/csscomb') : require('../lib/csscomb');
var fs = require('fs');
var assert = require('assert');

Expand Down

0 comments on commit ae6ce00

Please sign in to comment.