Permalink
Browse files

Add istanbul code coverage

1 parent 1bd8d38 commit 9ab31e1fc6c94e5c13f9e6a10e23b1c1ed79c504 @kpdecker kpdecker committed Aug 14, 2014
Showing with 17 additions and 2 deletions.
  1. +1 −0 .gitignore
  2. +2 −0 .istanbul.yml
  3. +2 −1 package.json
  4. +12 −1 tasks/test.js
View
@@ -4,6 +4,7 @@ vendor
lib/handlebars/compiler/parser.js
/dist/
/tmp/
+/coverage/
node_modules
*.sublime-project
*.sublime-workspace
View
@@ -0,0 +1,2 @@
+instrumentation:
+ excludes: ['**/spec/**']
View
@@ -32,6 +32,7 @@
"benchmark": "~1.0",
"dustjs-linkedin": "~2.0.2",
"eco": "~1.1.0-rc-3",
+ "es6-module-packager": "1.x",
"grunt": "~0.4.1",
"grunt-cli": "~0.1.10",
"grunt-contrib-clean": "~0.4.1",
@@ -43,7 +44,7 @@
"grunt-contrib-uglify": "~0.2.2",
"grunt-contrib-watch": "~0.5.3",
"grunt-saucelabs": "8.x",
- "es6-module-packager": "1.x",
+ "istanbul": "^0.3.0",
"jison": "~0.3.0",
"keen.io": "0.0.3",
"mocha": "~1.20.0",
View
@@ -29,5 +29,16 @@ module.exports = function(grunt) {
done();
});
});
- grunt.registerTask('test', ['test:bin', 'test:mocha']);
+ grunt.registerTask('test:cov', function() {
+ var done = this.async();
+
+ var runner = childProcess.fork('node_modules/.bin/istanbul', ['cover', '--', './spec/env/runner.js'], {stdio: 'inherit'});
+ runner.on('close', function(code) {
+ if (code != 0) {
+ grunt.fatal(code + ' tests failed');
+ }
+ done();
+ });
+ });
+ grunt.registerTask('test', ['test:bin', 'test:cov']);
};

0 comments on commit 9ab31e1

Please sign in to comment.