Skip to content

Commit

Permalink
feat(test): Add codecoverage feedback to karma using istanbul
Browse files Browse the repository at this point in the history
Closes #4055. Closes #4056
  • Loading branch information
thaiat authored and mhartington committed Aug 18, 2015
1 parent 851d017 commit e5e410a
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -25,3 +25,6 @@ temp
dist

.idea

# Coverage directory used by tools like istanbul
coverage/
22 changes: 19 additions & 3 deletions config/karma.conf.js
Expand Up @@ -19,17 +19,33 @@ module.exports = {
exclude: [
'js/ext/angular/test/dom-trace.js'
],

preprocessors: {
'js/**/*.js': 'coverage'
},
frameworks: ['jasmine'],
reporters: ['progress'],
reporters: ['progress', 'coverage'],
port: 9876,
colors: true,
// possible values: 'OFF', 'ERROR', 'WARN', 'INFO', 'DEBUG'
logLevel: 'INFO',
autoWatch: true,
captureTimeout: 60000,
singleRun: false,

mochaReporter: {
output: 'full'
},
coverageReporter: {
reporters: [{
type: 'text'
}, {
type: 'text-summary'
}, {
type: 'cobertura',
file: 'coverage.xml'
}, {
type: 'lcov'
}]
},
// Start these browsers, currently available:
// - Chrome
// - ChromeCanary
Expand Down
6 changes: 6 additions & 0 deletions package.json
Expand Up @@ -32,13 +32,17 @@
"gulp-util": "^2.2.14",
"htmlparser2": "3.7.0",
"ircb": "^0.3.1",
"istanbul": "^0.3.17",
"istanbul-instrumenter-loader": "^0.1.3",
"jasmine-node": "^1.14.3",
"js-string-escape": "^1.0.0",
"js-yaml": "^3.0.2",
"jshint-summary": "^0.3.0",
"karma": "^0.12.23",
"karma-chrome-launcher": "^0.1.4",
"karma-coverage": "^0.4.2",
"karma-jasmine": "~0.1.5",
"karma-mocha-reporter": "^1.0.2",
"karma-phantomjs-launcher": "~0.1.2",
"karma-sauce-launcher": "~0.2.0",
"karma-script-launcher": "~0.1.0",
Expand All @@ -48,6 +52,7 @@
"marked": "^0.3.2",
"minimist": "0.0.8",
"mkdirp": "^0.3.5",
"node-libs-browser": "^0.5.2",
"node-twitter-api": "^1.2.2",
"node-uuid": "^1.4.1",
"protractor": "^0.23.1",
Expand All @@ -56,6 +61,7 @@
"sauce-connect-launcher": "^0.2.2",
"semver": "^2.2.1",
"through": "^2.3.4",
"webpack": "^1.10.1",
"winston": "^0.7.2"
},
"licenses": [
Expand Down
2 changes: 1 addition & 1 deletion scripts/circle/test.sh
Expand Up @@ -25,7 +25,7 @@ function run {
0)
[ -z $IS_MASTER ] || node_modules/.bin/gulp ddescribe-iit
node_modules/.bin/gulp eslint
node_modules/.bin/gulp karma --browsers=PhantomJS --reporters=dots
node_modules/.bin/gulp karma --browsers=PhantomJS --reporters=dots,coverage
;;
1)
# node_modules/.bin/gulp snapshot-sauce \
Expand Down

0 comments on commit e5e410a

Please sign in to comment.