From dc81294dd1f68e3c79add77783bd66e4672ae7ca Mon Sep 17 00:00:00 2001 From: Jason Dobry Date: Sat, 24 Oct 2015 03:02:12 +0000 Subject: [PATCH] Added code coverage --- .gitignore | 1 + .npmignore | 36 ++++++++++++++++++++++++++++++++++++ README.md | 41 +++++++++++++++++++++++++++++++---------- circle.yml | 3 +++ package.json | 15 ++++++++++----- 5 files changed, 81 insertions(+), 15 deletions(-) create mode 100644 .npmignore diff --git a/.gitignore b/.gitignore index 5a0bf29..645ffd9 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,4 @@ node_modules .idea/ *.iml +coverage/ \ No newline at end of file diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..0e75e56 --- /dev/null +++ b/.npmignore @@ -0,0 +1,36 @@ +# Logs +logs +*.log + +# Runtime data +pids +*.pid +*.seed + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release + +# Dependency directory +# Commenting this out is preferred by some people, see +# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git- +node_modules + +# Users Environment Variables +.lock-wscript + +.idea/ +*.iml +coverage/ +src/ +test/ +mocha.start.js +webpack.config.js \ No newline at end of file diff --git a/README.md b/README.md index c921b61..b32ae0f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ js-data logo -## js-data-sql [![npm version](https://img.shields.io/npm/v/js-data-sql.svg?style=flat-square)](https://www.npmjs.org/package/js-data-sql) [![Circle CI](https://img.shields.io/circleci/project/js-data/js-data-sql/master.svg?style=flat-square)](https://circleci.com/gh/js-data/js-data-sql/tree/master) [![npm downloads](https://img.shields.io/npm/dm/js-data-sql.svg?style=flat-square)](https://www.npmjs.org/package/js-data-sql) +## js-data-sql [![Slack Status][sl_b]][sl_l] [![npm version][npm_b]][npm_l] [![Circle CI][circle_b]][circle_l] [![npm downloads][dn_b]][dn_l] [![Coverage Status][cov_b]][cov_l] [![Codacy][cod_b]][cod_l] Postgres/MySQL/MariaDB/SQLite3 adapter for [js-data](http://www.js-data.io/). @@ -8,7 +8,7 @@ Postgres/MySQL/MariaDB/SQLite3 adapter for [js-data](http://www.js-data.io/). [DSSqlAdapter](http://www.js-data.io/docs/dssqladapter) ### Quick Start -`npm install --save js-data js-data-sql`. +`npm install --save knex js-data js-data-sql`. You also need to install the driver for the database you want to connect to. @@ -39,7 +39,7 @@ Read about using [JSData on the Server](http://www.js-data.io/docs/jsdata-on-the [CHANGELOG.md](https://github.com/js-data/js-data-sql/blob/master/CHANGELOG.md) ### Community -- [Gitter Channel](https://gitter.im/js-data/js-data) - Better than IRC! +- [Slack Channel](http://slack.js-data.io) - Better than IRC! - [Announcements](http://www.js-data.io/blog) - [Mailing List](https://groups.io/org/groupsio/jsdata) - Ask your questions! - [Issues](https://github.com/js-data/js-data-sql/issues) - Found a bug? Feature request? Submit an issue! @@ -48,19 +48,26 @@ Read about using [JSData on the Server](http://www.js-data.io/docs/jsdata-on-the ### Contributing -First, support is handled via the [Gitter Channel](https://gitter.im/js-data/js-data) and the [Mailing List](https://groups.io/org/groupsio/jsdata). Ask your questions there. +First, support is handled via the [Slack Channel](http://slack.js-data.io) and +the [Mailing List](https://groups.io/org/groupsio/jsdata). Ask your questions +there. -When submitting issues on GitHub, please include as much detail as possible to make debugging quick and easy. +When submitting issues on GitHub, please include as much detail as possible to +make debugging quick and easy. -- good - Your versions of js-data, js-data-sql, etc., relevant console logs/error, code examples that revealed the issue -- better - A [plnkr](http://plnkr.co/), [fiddle](http://jsfiddle.net/), or [bin](http://jsbin.com/?html,output) that demonstrates the issue -- best - A Pull Request that fixes the issue, including test coverage for the issue and the fix +- good - Your versions of js-data, js-data-sql, etc., relevant console +logs/error, code examples that revealed the issue +- better - A [plnkr](http://plnkr.co/), [fiddle](http://jsfiddle.net/), or +[bin](http://jsbin.com/?html,output) that demonstrates the issue +- best - A Pull Request that fixes the issue, including test coverage for the +issue and the fix [Github Issues](https://github.com/js-data/js-data-sql/issues). #### Submitting Pull Requests -1. Contribute to the issue/discussion that is the reason you'll be developing in the first place +1. Contribute to the issue/discussion that is the reason you'll be developing in +the first place 1. Fork js-data-sql 1. `git clone git@github.com:/js-data-sql.git` 1. `cd js-data-sql; npm install;` @@ -68,7 +75,8 @@ When submitting issues on GitHub, please include as much detail as possible to m 1. Run `npm test` (build and test) - You need io.js or Node 4.x that includes generator support without a flag 1. Your code will be linted and checked for formatting, the tests will be run -1. The `dist/` folder & files will be generated, do NOT commit `dist/*`! They will be committed when a release is cut. +1. The `dist/` folder & files will be generated, do NOT commit `dist/*`! They +will be committed when a release is cut. 1. Submit your PR and we'll review! 1. Thanks! @@ -109,3 +117,16 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +[sl_b]: http://slack.js-data.io/badge.svg +[sl_l]: http://slack.js-data.io +[npm_b]: https://img.shields.io/npm/v/js-data-sql.svg?style=flat +[npm_l]: https://www.npmjs.org/package/js-data-sql +[circle_b]: https://img.shields.io/circleci/project/js-data/js-data-sql/master.svg?style=flat +[circle_l]: https://circleci.com/gh/js-data/js-data-sql/tree/master +[dn_b]: https://img.shields.io/npm/dm/js-data-sql.svg?style=flat +[dn_l]: https://www.npmjs.org/package/js-data-sql +[cov_b]: https://img.shields.io/coveralls/js-data/js-data-sql/master.svg?style=flat +[cov_l]: https://coveralls.io/github/js-data/js-data-sql?branch=master +[cod_b]: https://img.shields.io/codacy/307c2e9399394fdaa5354cda7329516d.svg +[cod_l]: https://www.codacy.com/app/jasondobry/js-data-sql/dashboard diff --git a/circle.yml b/circle.yml index 8bcf7f9..c2da8a5 100644 --- a/circle.yml +++ b/circle.yml @@ -5,3 +5,6 @@ machine: database: override: - mysql -u ubuntu circle_test < test/setup.sql +test: + override: + - npm run ci diff --git a/package.json b/package.json index 548244a..6083fed 100644 --- a/package.json +++ b/package.json @@ -31,17 +31,22 @@ "babel-loader": "5.3.2", "bluebird": "2.10.2", "chai": "3.3.0", - "co": "^4.6.0", + "co": "4.6.0", "co-mocha": "1.1.2", + "codacy-coverage": "1.1.3", + "coveralls": "2.11.4", + "istanbul": "0.4.0", "mocha": "2.3.3", "standard": "5.3.1", "webpack": "1.12.2" }, "scripts": { - "lint": "node_modules/standard/bin/cmd.js src/index.js", - "build": "node_modules/webpack/bin/webpack.js --config webpack.config.js --progress --colors", - "mocha": "mocha --timeout 20000 --reporter spec mocha.start.js test/*.spec.js", - "test": "npm run lint && npm run build && npm run mocha" + "lint": "standard src/index.js", + "build": "webpack --config webpack.config.js --progress --colors", + "mocha": "mocha --timeout 20000 --reporter dot mocha.start.js test/*.spec.js", + "cover": "istanbul cover --hook-run-in-context node_modules/mocha/bin/_mocha -- --timeout 20000 --reporter dot mocha.start.js test/*.spec.js", + "test": "npm run lint && npm run build && npm run cover", + "ci": "npm run test && cat coverage/lcov.info | coveralls || true && cat ./coverage/lcov.info | codacy-coverage || true" }, "standard": { "parser": "babel-eslint"