Skip to content

Commit

Permalink
Copied istanbul register file from coffee coverage to add custom excl…
Browse files Browse the repository at this point in the history
…uded files
  • Loading branch information
Akaryatrh committed Jan 25, 2016
1 parent d10ee5c commit c26e294
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 7 deletions.
2 changes: 0 additions & 2 deletions .istanbul.yml

This file was deleted.

11 changes: 7 additions & 4 deletions GruntFile.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,16 @@ module.exports = (grunt) ->

watch:
coffee:
files: [
'src/**/*.coffee'
],
files: ['**/*.coffee']
tasks: ['coffee']
options:
liveReload: true

config:
options:
reload: true
files: ['GruntFile.coffee']

shell:
options:
stderr: true
Expand All @@ -91,4 +94,4 @@ module.exports = (grunt) ->

grunt.registerTask 'package', ['coffee', 'prompt', 'package-version']

return
return
15 changes: 15 additions & 0 deletions coffee-coverage-hook.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Had to mimic this file to add my own exclude paths
// https://github.com/benbria/coffee-coverage/blob/master/register-istanbul.js
// It's then required in mocha.opts file instead of coffee-coverage/register-istanbul
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', 'GruntFile.coffee', '**/index.coffee'],
coverageVar: coverageVar,
writeOnExit: writeOnExit ? ((_ref = process.env.COFFEECOV_OUT) != null ? _ref : 'coverage/coverage-coffee.json') : null,
initAll: (_ref = process.env.COFFEECOV_INIT_ALL) != null ? (_ref === 'true') : true
});
2 changes: 1 addition & 1 deletion test/mocha.opts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
--compilers coffee:coffee-script/register
--require coffee-coverage/register-istanbul
--require coffee-coverage-hook
--recursive
--check-leaks

0 comments on commit c26e294

Please sign in to comment.