Skip to content

Commit

Permalink
Merge branch 'master' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
jmdobry committed May 11, 2016
2 parents 87ccccb + e520456 commit 638aaeb
Show file tree
Hide file tree
Showing 8 changed files with 119 additions and 132 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ bower_components/
*.iml

rethinkdb_data/
doc/
doc/
.nyc_output/
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
##### 3.0.0-beta.5 - 10 May 2016

###### Breaking changes
- Removed default import, which wasn't working

##### 3.0.0-beta.4 - 10 May 2016

###### Breaking changes
Expand Down
8 changes: 4 additions & 4 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ general:
- gh-pages
machine:
node:
version: 4.1.0
version: 5.7.0
dependencies:
pre:
- npm i js-data@^3.0.0-beta.3 rethinkdbdash
- npm i -g npm codecov
- npm i js-data@^3.0.0-beta.5 rethinkdbdash
- source /etc/lsb-release && echo "deb http://download.rethinkdb.com/apt $DISTRIB_CODENAME main" | sudo tee /etc/apt/sources.list.d/rethinkdb.list
- wget -qO- http://download.rethinkdb.com/apt/pubkey.gpg | sudo apt-key add -
- sudo apt-get update -qq
Expand All @@ -17,7 +18,6 @@ dependencies:
- ulimit -S -n 2048
- sleep 10
test:
override:
- npm run ci
post:
- cat coverage/lcov.info | codecov
- sudo killall rethinkdb
48 changes: 39 additions & 9 deletions mocha.start.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
'use strict'

// prepare environment for js-data-adapter-tests
require('babel-polyfill')
import 'babel-polyfill'

var JSData = require('js-data')
var JSDataAdapterTests = require('js-data-adapter-tests')
var JSDataRethinkDB = require('./')
import * as JSData from 'js-data'
import JSDataAdapterTests from 'js-data-adapter-tests'
import * as JSDataRethinkDB from './src/index'

var assert = global.assert = JSDataAdapterTests.assert
const assert = global.assert = JSDataAdapterTests.assert
global.sinon = JSDataAdapterTests.sinon

JSDataAdapterTests.init({
Expand All @@ -28,16 +28,46 @@ JSDataAdapterTests.init({
]
})

require('./test/handleErrors.test')
describe('RethinkDBAdapter#handleErrors(err)', function () {
it('should do nothing when passed a falsy value', function () {
var Test = this
assert.doesNotThrow(function () {
Test.$$adapter._handleErrors(false)
})
})
it('should do nothing when errors is 0', function () {
var Test = this
assert.doesNotThrow(function () {
Test.$$adapter._handleErrors({
errors: 0
})
})
})
it('should throw an error when errors > 0 && first_error is a string', function () {
var Test = this
var errorString = 'error string'
assert.throws(function () {
Test.$$adapter._handleErrors({
errors: 1,
first_error: errorString
})
}, Error, errorString)
})
it('should throw a generic error when errors > 0 && first_error is nothing', function () {
var Test = this
assert.throws(function () {
Test.$$adapter._handleErrors({
errors: 1
})
}, Error, 'Unknown RethinkDB Error')
})
})

describe('exports', function () {
it('should have correct exports', function () {
assert(JSDataRethinkDB.default)
assert(JSDataRethinkDB.RethinkDBAdapter)
assert(JSDataRethinkDB.RethinkDBAdapter === JSDataRethinkDB.default)
assert(JSDataRethinkDB.OPERATORS)
assert(JSDataRethinkDB.OPERATORS['=='])
assert(JSDataRethinkDB.version)
assert(JSDataRethinkDB.version.full)
})
})
23 changes: 15 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "js-data-rethinkdb",
"description": "RethinkDB adapter for js-data.",
"version": "3.0.0-beta.4",
"version": "3.0.0-beta.5",
"homepage": "https://github.com/js-data/js-data-rethinkdb",
"repository": {
"type": "git",
Expand Down Expand Up @@ -38,22 +38,29 @@
"beforeEach",
"afterEach"
],
"ignore": ["dist/"]
"ignore": [
"dist/"
]
},
"babel": {
"presets": ["es2015-rollup"]
"presets": [
"es2015"
],
"plugins": [
"syntax-async-functions",
"transform-regenerator"
]
},
"scripts": {
"lint": "repo-tools lint \"**/*.js\"",
"bundle": "rollup -c rollup.config.js -f cjs -o dist/js-data-rethinkdb.js -m dist/js-data-rethinkdb.js.map src/index.js && repo-tools write-version dist/js-data-rethinkdb.js",
"doc": "jsdoc -c conf.json src node_modules/js-data-adapter/src",
"watch": "watch \"npm run bundle\" src/",
"build": "npm run lint && npm run bundle",
"mocha": "mocha -t 30000 -R dot -r source-map-support/register mocha.start.js",
"cover": "istanbul cover --hook-run-in-context node_modules/mocha/bin/_mocha -- -t 30000 -R dot -r source-map-support/register mocha.start.js",
"mocha": "mocha -t 20000 -R dot -r babel-core/register -r babel-polyfill mocha.start.js",
"cover": "nyc --require babel-core/register --require babel-polyfill --cache mocha -t 20000 -R dot mocha.start.js && nyc report --reporter=html",
"test": "npm run build && npm run cover",
"release": "npm test && npm run doc && repo-tools updates && repo-tools changelog && repo-tools authors",
"ci": "npm run test && cat coverage/lcov.info | codecov"
"release": "npm test && npm run doc && repo-tools updates && repo-tools changelog && repo-tools authors"
},
"dependencies": {
"js-data-adapter": "~0.6.1",
Expand All @@ -66,9 +73,9 @@
"devDependencies": {
"babel-polyfill": "6.8.0",
"babel-preset-es2015-rollup": "1.1.1",
"istanbul": "0.4.3",
"js-data-adapter-tests": "^2.0.0-alpha.20",
"js-data-repo-tools": "0.5.1",
"nyc": "6.4.4",
"rollup": "0.26.2",
"rollup-plugin-babel": "2.4.0",
"source-map-support": "0.4.0",
Expand Down
4 changes: 4 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ module.exports = {
],
plugins: [
babel({
babelrc: false,
presets: [
'es2015-rollup'
],
exclude: 'node_modules/**'
})
]
Expand Down
Loading

0 comments on commit 638aaeb

Please sign in to comment.