From 31011ef3aa451cfb562332b376c7f88ac4cfb679 Mon Sep 17 00:00:00 2001 From: Eric Kryski Date: Mon, 17 Oct 2016 04:18:49 -0600 Subject: [PATCH] adding code coverage --- .istanbul.yml | 17 +++++++++++++++++ .npmignore | 6 +++++- .travis.yml | 16 +++++++++++++--- README.md | 6 +++++- mocha.opts | 3 +++ package.json | 6 ++++-- 6 files changed, 47 insertions(+), 7 deletions(-) create mode 100644 .istanbul.yml create mode 100644 mocha.opts diff --git a/.istanbul.yml b/.istanbul.yml new file mode 100644 index 0000000..caa27a6 --- /dev/null +++ b/.istanbul.yml @@ -0,0 +1,17 @@ +verbose: false +instrumentation: + root: ./src/ + excludes: + - lib/ + include-all-sources: true +reporting: + print: summary + reports: + - html + - text + - lcov + watermarks: + statements: [50, 80] + lines: [50, 80] + functions: [50, 80] + branches: [50, 80] \ No newline at end of file diff --git a/.npmignore b/.npmignore index 3b851a1..b1a9630 100644 --- a/.npmignore +++ b/.npmignore @@ -1,4 +1,8 @@ +.editorconfig +.travis.yml +.istanbul.yml +.babelrc .idea/ src/ test/ -!lib/ \ No newline at end of file +!lib/ diff --git a/.travis.yml b/.travis.yml index efead83..bd44fb7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,15 @@ sudo: required language: node_js +node_js: + - 'node' + - '6' + - '4' + - 'iojs' #end of life Jan. 2017 + - '0.12' #end of life Jan. 2017 + - '0.10' #end of life Jan. 2017 +addons: + code_climate: + repo_token: '7923d082ec24c66c6e2b85339b00191a7701678418ec1b4cbbfb42b6110eab7a' before_install: - echo "deb http://download.rethinkdb.com/apt `lsb_release -cs` main" | sudo tee /etc/apt/sources.list.d/rethinkdb.list - wget -qO- https://download.rethinkdb.com/apt/pubkey.gpg | sudo apt-key add - @@ -7,6 +17,6 @@ before_install: - sudo apt-get install rethinkdb before_script: - rethinkdb --daemon -node_js: - - 'node' - - 'iojs' + - npm install -g codeclimate-test-reporter +after_script: + - codeclimate-test-reporter < coverage/lcov.info \ No newline at end of file diff --git a/README.md b/README.md index 8a6fc8d..c1390fa 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,11 @@ feathers-rethinkdb ================== -[![Build Status](https://travis-ci.org/feathersjs/feathers-rethinkdb.svg?branch=master)](https://travis-ci.org/feathersjs/feathers-rethinkdb) +[![Build Status](https://travis-ci.org/feathersjs/feathers-rethinkdb.png?branch=master)](https://travis-ci.org/feathersjs/feathers-rethinkdb) +[![Code Climate](https://codeclimate.com/github/feathersjs/feathers-rethinkdb/badges/gpa.svg)](https://codeclimate.com/github/feathersjs/feathers-rethinkdb) +[![Test Coverage](https://codeclimate.com/github/feathersjs/feathers-rethinkdb/badges/coverage.svg)](https://codeclimate.com/github/feathersjs/feathers-rethinkdb/coverage) +[![Dependency Status](https://img.shields.io/david/feathersjs/feathers-rethinkdb.svg?style=flat-square)](https://david-dm.org/feathersjs/feathers-rethinkdb) +[![Download Status](https://img.shields.io/npm/dm/feathers-rethinkdb.svg?style=flat-square)](https://www.npmjs.com/package/feathers-rethinkdb) > Create a [RethinkDB](https://rethinkdb.com/) Service for [FeatherJS](https://github.com/feathersjs). diff --git a/mocha.opts b/mocha.opts new file mode 100644 index 0000000..91dd6b9 --- /dev/null +++ b/mocha.opts @@ -0,0 +1,3 @@ +--recursive test/ +--compilers js:babel-core/register + --timeout 5000 \ No newline at end of file diff --git a/package.json b/package.json index 6434c58..d4bf291 100644 --- a/package.json +++ b/package.json @@ -36,8 +36,9 @@ "compile": "rm -rf lib/ && babel -d lib/ src/", "watch": "babel --watch -d lib/ src/", "jshint": "jshint src/. test/. --config", - "mocha": "mocha test/ --compilers js:babel-core/register --timeout 5000", - "test": "rm -rf db-data && npm run compile && npm run jshint && npm run mocha" + "mocha": "mocha --opts mocha.opts", + "coverage": "istanbul cover _mocha -- --opts mocha.opts", + "test": "rm -rf db-data && npm run compile && npm run jshint && npm run coverage" }, "directories": { "lib": "lib" @@ -60,6 +61,7 @@ "feathers-rest": "^1.2.4", "feathers-service-tests": "^0.6.2", "feathers-socketio": "^1.3.3", + "istanbul": "^1.1.0-alpha.1", "jshint": "^2.9.1", "mocha": "^3.0.0", "rethinkdbdash": "^2.2.18"