Browse Source

Add coverage report

pull/1403/head
Yoshiya Hinosawa 9 years ago
parent
commit
4ed3742e44
  1. 3
      .gitignore
  2. 3
      .travis.yml
  3. 10
      karma.conf.js
  4. 6
      package.json

3
.gitignore vendored

@ -6,3 +6,6 @@ d3.min.js
components
build
.sass-cache
# coverage report
/coverage

3
.travis.yml

@ -7,3 +7,6 @@ before_script:
script:
- npm run lint
- npm test
after_success:
- npm run codecov

10
karma.conf.js

@ -31,13 +31,19 @@ module.exports = function(config) {
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
'c3.js': ['coverage']
},
// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['spec'],
reporters: ['spec', 'coverage'],
coverageReporter: {
reporters: [{type: 'lcov'}]
},
// web server port
@ -50,7 +56,7 @@ module.exports = function(config) {
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_DEBUG,
logLevel: config.LOG_INFO,
// enable / disable watching file and executing tests whenever any file changes

6
package.json

@ -5,7 +5,8 @@
"main": "c3.js",
"scripts": {
"lint": "grunt lint",
"test": "karma start karma.conf.js"
"test": "karma start karma.conf.js",
"codecov": "cat coverage/*/lcov.info | codecov"
},
"repository": {
"type": "git",
@ -24,6 +25,7 @@
"d3": "<=3.5.0"
},
"devDependencies": {
"codecov.io": "^0.1.6",
"grunt": "^0.4.5",
"grunt-contrib-concat": "~0.5.0",
"grunt-contrib-cssmin": "^0.10.0",
@ -33,8 +35,10 @@
"grunt-sass": "^0.17.0",
"jasmine-core": "^2.3.4",
"karma": "^0.13.10",
"karma-coverage": "^0.5.2",
"karma-jasmine": "^0.3.6",
"karma-phantomjs-launcher": "^0.2.1",
"karma-spec-reporter": "0.0.20",
"load-grunt-tasks": "~0.2.0",
"phantomjs": "^1.9.18"
}

Loading…
Cancel
Save