Browse Source

Merge branch 'feature/coverage' of https://github.com/kt3k/c3 into kt3k-feature/coverage

pull/1414/merge
Masayuki Tanaka 9 years ago
parent
commit
d341e5d3e1
  1. 3
      .gitignore
  2. 7
      .travis.yml
  3. 13
      Gruntfile.coffee
  4. 77
      karma.conf.js
  5. 15
      package.json

3
.gitignore vendored

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

7
.travis.yml

@ -3,3 +3,10 @@ language: node_js
before_script:
- npm install -g grunt-cli
- gem install sass
script:
- npm run lint
- npm test
after_success:
- npm run codecov

13
Gruntfile.coffee

@ -85,15 +85,6 @@ module.exports = (grunt) ->
options:
jshintrc: '.jshintrc'
jasmine:
c3:
src: 'c3.js'
options:
specs: 'spec/*-spec.js'
helpers: 'spec/*-helper.js'
styles: 'c3.css'
vendor: 'https://rawgit.com/mbostock/d3/v3.5.0/d3.min.js'
uglify:
c3:
files:
@ -111,4 +102,6 @@ module.exports = (grunt) ->
files:
'c3.css': 'src/scss/main.scss'
grunt.registerTask 'default', ['concat', 'jshint', 'jasmine', 'sass', 'cssmin', 'uglify']
grunt.registerTask 'lint', ['jshint']
grunt.registerTask 'build', ['concat', 'sass', 'cssmin', 'uglify']
grunt.registerTask 'defualt', ['lint', 'build']

77
karma.conf.js

@ -0,0 +1,77 @@
// Karma configuration
// Generated on Wed Sep 30 2015 22:01:48 GMT+0900 (KST)
module.exports = function(config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',
// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['jasmine'],
// list of files / patterns to load in the browser
files: [
'node_modules/d3/d3.min.js',
'c3.js',
'c3.css',
'spec/*-helper.js',
'spec/*-spec.js'
],
// list of files to exclude
exclude: [
],
// 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', 'coverage'],
coverageReporter: {
reporters: [{type: 'lcov'}]
},
// web server port
port: 9876,
// enable / disable colors in the output (reporters and logs)
colors: true,
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,
// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,
// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['PhantomJS'],
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: true,
browserNoActivityTimeout: 60000,
})
}

15
package.json

@ -4,7 +4,9 @@
"description": "D3-based reusable chart library",
"main": "c3.js",
"scripts": {
"test": "grunt"
"lint": "grunt lint",
"test": "karma start karma.conf.js",
"codecov": "cat coverage/*/lcov.info | codecov"
},
"repository": {
"type": "git",
@ -23,14 +25,21 @@
"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",
"grunt-contrib-jasmine": "~0.8.0",
"grunt-contrib-jshint": "~0.10.0",
"grunt-contrib-uglify": "~0.4.0",
"grunt-contrib-watch": "^0.6.1",
"grunt-sass": "^0.17.0",
"load-grunt-tasks": "~0.2.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