diff --git a/.travis.yml b/.travis.yml index cf090cb6a..cbde6368a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,9 +10,17 @@ addons: packages: - libgif-dev - g++-4.8 + code_climate: + repo_token: 07de009e5f4d0a43c51b18f3443b2fe7ddcf3fea206e75c3a81b1c4030657f69 +cache: + directories: + - node_modules before_script: - npm run lint - npm install gulp script: - gulp - - npm test + - npm run-script test-cov +after_script: + - npm install -g codeclimate-test-reporter + - codeclimate-test-reporter < ./coverage/lcov.info diff --git a/README.md b/README.md index 9491657f1..a82cc230c 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ The vis.js library was initially developed by [Almende B.V](http://almende.com). [![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/almende/vis.svg)](http://isitmaintained.com/project/almende/vis "Average time to resolve an issue") [![Pending Pull-Requests](http://githubbadges.herokuapp.com/almende/vis/pulls.svg)](https://github.com/almende/vis/pulls) +[![Test Coverage](https://codeclimate.com/github/almende/vis/badges/coverage.svg)](https://codeclimate.com/github/almende/vis/coverage) [![Code Climate](https://codeclimate.com/github/almende/vis/badges/gpa.svg)](https://codeclimate.com/github/almende/vis) ## Install diff --git a/package.json b/package.json index c98274f76..bf880c63e 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "main": "./dist/vis.js", "scripts": { "test": "mocha --compilers js:babel-core/register", + "test-cov": "nyc --reporter=lcov mocha --compilers js:babel-core/register", "build": "gulp", "lint": "gulp lint", "watch": "gulp watch", @@ -43,10 +44,10 @@ "async": "^2.5.0", "babel-core": "^6.25.0", "babel-loader": "^7.1.1", - "babel-polyfill": "^6.23.0", "babel-plugin-transform-es3-member-expression-literals": "^6.22.0", "babel-plugin-transform-es3-property-literals": "^6.22.0", "babel-plugin-transform-runtime": "^6.23.0", + "babel-polyfill": "^6.23.0", "babel-preset-es2015": "^6.24.1", "babel-runtime": "^6.23.0", "babelify": "^7.3.0", @@ -54,9 +55,9 @@ "clean-css": "^4.1.7", "eslint": "^4.3.0", "gulp": "^3.9.1", - "gulp-eslint": "^4.0.0", "gulp-clean-css": "^3.7.0", "gulp-concat": "^2.6.1", + "gulp-eslint": "^4.0.0", "gulp-rename": "^1.2.2", "gulp-util": "^3.0.8", "jsdom": "9.12.0", @@ -64,6 +65,7 @@ "merge-stream": "^1.0.1", "mocha": "^3.4.2", "mocha-jsdom": "^1.1.0", + "nyc": "^11.2.1", "rimraf": "^2.6.1", "test-console": "^1.0.0", "uglify-js": "^2.8.29",