Merge pull request #1368 from opf/feature/karma-coverage

Configure code coverage analysis with Karma
pull/1383/head
Martin Linkhorst 11 years ago
commit e1db340682
  1. 10
      karma.conf.js
  2. 28
      package.json

@ -117,6 +117,7 @@ module.exports = function(config) {
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
'app/assets/javascripts/angular/**/*.js': ['coverage'],
'public/templates/**/*.html': ['ng-html2js']
},
@ -124,7 +125,7 @@ module.exports = function(config) {
// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['progress', 'junit'],
reporters: ['progress', 'coverage', 'junit'],
// web server port
@ -159,6 +160,13 @@ module.exports = function(config) {
outputFile: 'karma/reports/test-results.xml'
},
coverageReporter: {
reporters: [
{ type: 'html', dir:'coverage/' },
{ type: 'cobertura' }
]
},
ngHtml2JsPreprocessor: {
stripPrefix: 'public',
moduleName: 'templates'

@ -3,30 +3,30 @@
"version": "0.1.0",
"devDependencies": {
"bower": "~1.3.3",
"chai": "~1.9.1",
"exec": "0.0.6",
"grunt": "~0.4.2",
"grunt-contrib-jshint": "~0.8.0",
"phantomjs": "~1.9.2",
"grunt-contrib-watch": "~0.5.3",
"grunt-jscoverage": "0.0.3",
"rimraf": "~2.2.5",
"grunt-karma": "~0.8.2",
"json2htmlcov": "~0.1.1",
"exec": "0.0.6",
"readable-stream": "1.1.11",
"karma": "~0.12.3",
"karma-coverage": "~0.0.3",
"karma-phantomjs-launcher": "~0.1.4",
"grunt-karma": "~0.8.2",
"mocha": "~1.18.2",
"karma-mocha": "~0.1.3",
"karma-chai": "~0.1.0",
"karma-chai-sinon": "~0.1.3",
"karma-chrome-launcher": "~0.1.3",
"karma-coverage": "^0.2.3",
"karma-firefox-launcher": "~0.1.3",
"chai": "~1.9.1",
"karma-chai": "~0.1.0",
"karma-ng-html2js-preprocessor": "~0.1.0",
"karma-junit-reporter": "~0.2.2",
"karma-mocha": "~0.1.3",
"karma-ng-html2js-preprocessor": "~0.1.0",
"karma-phantomjs-launcher": "~0.1.4",
"mocha": "~1.18.2",
"phantomjs": "~1.9.2",
"readable-stream": "1.1.11",
"rimraf": "~2.2.5",
"sinon": "~1.9.1",
"sinon-chai": "~2.5.0",
"karma-chai-sinon": "~0.1.3"
"sinon-chai": "~2.5.0"
},
"scripts": {
"test": "./node_modules/karma/bin/karma start --single-run --browsers Firefox,PhantomJS"

Loading…
Cancel
Save