diff --git a/.gitignore b/.gitignore index 8ba4b6f7..c43b3a21 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,9 @@ # Development-related files .tern-port +coverage/ node_modules/.bin node_modules/grunt* +node_modules/istanbul node_modules/jshint node_modules/load-grunt-tasks diff --git a/Gruntfile.js b/Gruntfile.js index 5eb12d06..00c11340 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -7,6 +7,7 @@ module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), nodeBin: path.resolve(__dirname, './jsdoc.js'), + nodePath: process.execPath, rhinoBin: (function() { var filepath = path.resolve(__dirname, './jsdoc'); @@ -37,6 +38,13 @@ module.exports = function(grunt) { files: ['package.json'] }, shell: { + 'coverage': { + command: './node_modules/.bin/istanbul cover <%= nodeBin %> -- -T', + options: { + stdout: true, + stderr: true + } + }, 'test-rhino': { command: '<%= rhinoBin %> -T -q "parser=rhino"', options: { @@ -52,7 +60,7 @@ module.exports = function(grunt) { } }, 'test-node': { - command: process.execPath + ' <%= nodeBin %> -T', + command: '<%= nodePath %> <%= nodeBin %> -T', options: { stdout: true, stderr: true @@ -65,6 +73,8 @@ module.exports = function(grunt) { grunt.renameTask('bumpup', 'bump'); + grunt.registerTask('coverage', ['shell:coverage']); + grunt.registerTask('test-rhino', ['shell:test-rhino']); grunt.registerTask('test-rhino-esprima', ['shell:test-rhino-esprima']); grunt.registerTask('test-node', ['shell:test-node']); diff --git a/package.json b/package.json index eb30ed9d..1bde0955 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "grunt": "~0.4.2", "grunt-bumpup": "~0.4.2", "grunt-shell": "~0.6.1", + "istanbul": "~0.2.1", "jshint": "~2.3.0", "load-grunt-tasks": "~0.2.1", "tv4": "git+https://github.com/hegemonic/tv4.git#own-properties"