Skip to content

Commit

Permalink
chore: added grunt coverage task
Browse files Browse the repository at this point in the history
  • Loading branch information
Johnny Estilles committed Apr 19, 2015
1 parent 1a0f25d commit ef6cf2c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
coverage
node_modules
npm-debug.log
tmp
15 changes: 15 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,18 @@ module.exports = function(grunt) {
},
src: ['test/**/*.spec.js']
}
},

mocha_istanbul: {
coverage: {
src: './test', // a folder works nicely
options: {
mask: '*.spec.js',
reporFormat: ['lcov', 'html']
}
}
}

});

// Actually load this plugin's task(s).
Expand All @@ -78,11 +89,15 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-mocha-istanbul');

// Whenever the "test" task is run, first clean the "tmp" dir, then run this
// plugin's task(s), then test the result.
grunt.registerTask('test', ['clean', 'git_changelog', 'mochaTest']);

// Determine test coverage
grunt.registerTask('coverage', ['test', 'mocha_istanbul:coverage']);

// By default, lint and run all tests.
grunt.registerTask('default', ['jshint', 'test']);

Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@
"grunt": "^0.4.5",
"grunt-contrib-clean": "~0.4.0",
"grunt-contrib-jshint": "~0.6.0",
"grunt-mocha-istanbul": "^2.4.0",
"grunt-mocha-test": "^0.12.1",
"istanbul": "^0.3.13",
"mocha": "^1.21.4"
},
"peerDependencies": {
Expand Down

0 comments on commit ef6cf2c

Please sign in to comment.