diff --git a/.gitignore b/.gitignore index d63fa19..1c9bb6e 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ tmp/ bower_components/ build/ site/ +coverage/ diff --git a/karma.conf.js b/karma.conf.js index 0f02a37..e8dc973 100755 --- a/karma.conf.js +++ b/karma.conf.js @@ -29,7 +29,7 @@ module.exports = function(config) { // preprocess matching files before serving them to the browser // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor preprocessors: { - 'cruft/**/*.js': ['traceur'], + 'cruft/**/*.js': ['traceur', 'coverage'], 'tests/**/*.test.js': ['traceur'] }, @@ -43,10 +43,16 @@ module.exports = function(config) { } }, + coverageReporter: { + dir: 'coverage', + subdir: '.' + // Would output the results into: .'/coverage/' + }, + // test results reporter to use // possible values: 'dots', 'progress' // available reporters: https://npmjs.org/browse/keyword/karma-reporter - reporters: ['progress'], + reporters: ['progress', 'coverage'], // web server port @@ -68,7 +74,7 @@ module.exports = function(config) { // start these browsers // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher - browsers: ['PhantomJS'], + browsers: ['Chrome'], // Continuous Integration mode @@ -84,7 +90,8 @@ module.exports = function(config) { 'karma-traceur-preprocessor', 'karma-jasmine', 'karma-chrome-launcher', - 'karma-phantomjs-launcher' + 'karma-phantomjs-launcher', + 'karma-coverage' ] }) } diff --git a/package.json b/package.json index 48ad837..b1b04b1 100755 --- a/package.json +++ b/package.json @@ -23,12 +23,13 @@ "jasmine-core": "^2.4.1", "karma": "^0.13.21", "karma-browserify": "^5.0.1", - "karma-chrome-launcher": "^0.2.2", + "karma-chrome-launcher": "~0.2.2", "karma-jasmine": "^0.3.7", "karma-phantomjs-launcher": "^1.0.0", "karma-requirejs": "^0.2.5", "karma-traceur-preprocessor": "^0.4.0", "phantomjs-prebuilt": "^2.1.4", - "traceur": "0.0.102" + "traceur": "0.0.102", + "karma-coverage": "~0.5.3" } }