From 5563fc616885578ad51b2dfa6ccf70ccebf06126 Mon Sep 17 00:00:00 2001 From: macleodbroad-wf Date: Sat, 4 Nov 2017 15:02:42 -0400 Subject: [PATCH] =?UTF-8?q?Adds=20code-coverage=20badge,=20code=20coverage?= =?UTF-8?q?=20reports,=20and=20test-cov=20script=20=E2=80=A6=20(#3626)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Adds code-coverage badge, code coverage reports, and test-cov script to master. * install nyc * Correct badge url --- .travis.yml | 10 +++++++++- README.md | 1 + package.json | 6 ++++-- 3 files changed, 14 insertions(+), 3 deletions(-) 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..a82cc230 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 c98274f7..bf880c63 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",