Skip to content

Commit

Permalink
tweak covergae init
Browse files Browse the repository at this point in the history
  • Loading branch information
mose committed Jul 18, 2016
1 parent 8cbd725 commit 3169b24
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ columns.py
coffeelint.json
npm-debug.log
coverage
coffee-coverage.js
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ test-w:
test-coverage:
@NODE_ENV=test ./node_modules/.bin/mocha \
--compilers coffee:coffee-script \
--require coffee-coverage/register-istanbul \
--require ./coffee-coverage.js \
--reporter dot \
--ui tdd \
&& ./node_modules/.bin/istanbul report lcovonly

test-cov:
@NODE_ENV=test ./node_modules/.bin/mocha \
--compilers coffee:coffee-script \
--require coffee-coverage/register-istanbul \
--require ./coffee-coverage.js \
--reporter dot \
--ui tdd \
&& ./node_modules/.bin/istanbul report
Expand Down
12 changes: 12 additions & 0 deletions coffee-coverage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
var coffeeCoverage = require('coffee-coverage');
var coverageVar = coffeeCoverage.findIstanbulVariable();
var writeOnExit = coverageVar == null ? true : null;

coffeeCoverage.register({
instrumentor: 'istanbul',
basePath: process.cwd(),
exclude: ['/test', '/node_modules', '/.git', 'index.coffee'],
coverageVar: coverageVar,
writeOnExit: writeOnExit ? ((_ref = process.env.COFFEECOV_OUT) != null ? _ref : 'coverage/coverage-coffee.json') : null,
initAll: true
});
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"devDependencies": {
"chai": "^2.1.1",
"coffee-coverage": "^1.0.1",
"coffeelint": "^1.15.7",
"coveralls": "^2.11.11",
"es6-promise": "^3.2.1",
"hubot-test-helper": "1.4.4",
Expand All @@ -37,7 +38,8 @@
"sinon-chai": "^2.8.0"
},
"scripts": {
"test": "make test"
"test": "make test",
"lint": "coffeelint lib/phabricator.coffee scripts/phabs.coffee"
},
"main": "index.js"
}

0 comments on commit 3169b24

Please sign in to comment.