From c7ee0ec8456bee0e248583f0f6247a04d8055e82 Mon Sep 17 00:00:00 2001 From: MacLeod Broad <> Date: Fri, 27 Oct 2017 20:17:48 -0400 Subject: [PATCH 1/3] Adds code-coverage badge, code coverage reports, and test-cov script to master. --- .travis.yml | 10 +++++++++- README.md | 1 + package.json | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) 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..aecd6e281 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 c98274f76..e18d428d2 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", From 391de3e34e8c5b45d50776f80abec312461ba085 Mon Sep 17 00:00:00 2001 From: MacLeod Broad <> Date: Fri, 27 Oct 2017 20:25:24 -0400 Subject: [PATCH 2/3] install nyc --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index e18d428d2..bf880c63e 100644 --- a/package.json +++ b/package.json @@ -44,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", @@ -55,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", @@ -65,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", From 90337a9d606fc7f74ff74cfa207becf4b90c61c3 Mon Sep 17 00:00:00 2001 From: MacLeod Broad <> Date: Fri, 27 Oct 2017 20:36:48 -0400 Subject: [PATCH 3/3] Correct badge url --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index aecd6e281..a82cc230c 100644 --- a/README.md +++ b/README.md @@ -38,7 +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) +[![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