diff --git a/.travis.yml b/.travis.yml index cf090cb6..cbde6368 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 9491657f..aecd6e28 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/codeclimate/codeclimate/badges/coverage.svg)](https://codeclimate.com/github/codeclimate/codeclimate/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 c98274f7..e18d428d 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",