diff --git a/.gitignore b/.gitignore index 7f44b02..8e88127 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,4 @@ tmp .settings *.sublime-workspace *~ -test/coverage.html +test/coverage/* diff --git a/Gruntfile.js b/Gruntfile.js index 6baeed9..adb2a9f 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -14,7 +14,7 @@ module.exports = function(grunt) { grunt.initConfig({ clean: { all: { - src: [ "test/tmp", "test/coverage.html", "**/*~", "**/.*~" ] + src: [ "test/tmp", "test/coverage", "**/*~", "**/.*~" ] } }, @@ -34,11 +34,19 @@ module.exports = function(grunt) { }, src: ["test/**/*.js"] }, - coverage: { + coverage_html: { options: { reporter: "html-cov", quiet: true, - captureFile: "test/coverage.html" + captureFile: "test/coverage/coverage.html" + }, + src: ["test/**/*.js"] + }, + "mocha-lcov-reporter": { + options: { + reporter: "mocha-lcov-reporter", + quiet: true, + captureFile: "test/coverage/lcov.info" }, src: ["test/**/*.js"] }, @@ -48,12 +56,22 @@ module.exports = function(grunt) { }, src: ["test/**/*.js"] } + }, + + coveralls: { + options: { + force: true + }, + all: { + src: "test/coverage/lcov.info" + } } }); grunt.loadTasks("tasks"); grunt.loadNpmTasks("grunt-contrib-clean"); grunt.loadNpmTasks("grunt-contrib-jshint"); + grunt.loadNpmTasks("grunt-coveralls"); grunt.loadNpmTasks("grunt-mocha-test"); grunt.registerTask("test", ["jshint", "mochaTest"]); grunt.registerTask("default", ["test"]); diff --git a/package.json b/package.json index 34da6fd..888c877 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,9 @@ "grunt": "~0.4.4", "grunt-contrib-clean": "^0.5.0", "grunt-contrib-jshint": "^0.9.2", + "grunt-coveralls": "^0.3.0", "grunt-mocha-test": "^0.10.2", + "mocha-lcov-reporter": "^0.0.1", "should": "^3.3.1", "travis-cov": "^0.2.5" },