diff --git a/.travis.yml b/.travis.yml index fc89173..2c07d2c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,3 +4,4 @@ node_js: before_install: npm install -g grunt-cli bower install: npm install before_script: bower install +after_script: grunt coveralls \ No newline at end of file diff --git a/Gruntfile.js b/Gruntfile.js index f9e9353..1cfae73 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -25,6 +25,11 @@ module.exports = function(grunt) { configFile: 'karma.conf.js' } }, + coveralls: { + options: { + coverageDir: 'www/test/coverage/' + } + }, watch: { files: ['Gruntfile.js', 'www/js/**/*.js' @@ -292,7 +297,9 @@ module.exports = function(grunt) { grunt.loadNpmTasks('grunt-contrib-copy'); grunt.loadNpmTasks('grunt-phonegap'); grunt.loadNpmTasks('grunt-bumpup'); + grunt.loadNpmTasks('grunt-karma'); + grunt.loadNpmTasks('grunt-karma-coveralls'); grunt.registerTask('test', ['jshint', 'karma']); grunt.registerTask('build', [ diff --git a/karma.conf.js b/karma.conf.js index 8d74f60..2bbf5c1 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -49,8 +49,12 @@ module.exports = function(config) { }, coverageReporter: { - type: 'html', - dir: 'www/test/coverage/' + type: 'lcov', + dir: 'www/test/coverage/', + reporters: [ + // reporters not supporting the `file` property + { type: 'lcov', subdir: '.' } + ] }, // test results reporter to use diff --git a/package.json b/package.json index 9cbd681..c86184a 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,7 @@ "karma-chai": "~0.1.0", "karma-mocha-reporter": "~0.3.1", "grunt-karma": "~0.10.1", - "karma-phantomjs-launcher": "~0.1.4" + "karma-phantomjs-launcher": "~0.1.4", + "grunt-karma-coveralls": "~2.5.3" } }