Skip to content

Commit 638aaeb

Browse files
committed
Merge branch 'master' into release
2 parents 87ccccb + e520456 commit 638aaeb

8 files changed

+119
-132
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,5 @@ bower_components/
3232
*.iml
3333

3434
rethinkdb_data/
35-
doc/
35+
doc/
36+
.nyc_output/

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
##### 3.0.0-beta.5 - 10 May 2016
2+
3+
###### Breaking changes
4+
- Removed default import, which wasn't working
5+
16
##### 3.0.0-beta.4 - 10 May 2016
27

38
###### Breaking changes

circle.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ general:
44
- gh-pages
55
machine:
66
node:
7-
version: 4.1.0
7+
version: 5.7.0
88
dependencies:
99
pre:
10-
- npm i js-data@^3.0.0-beta.3 rethinkdbdash
10+
- npm i -g npm codecov
11+
- npm i js-data@^3.0.0-beta.5 rethinkdbdash
1112
- source /etc/lsb-release && echo "deb http://download.rethinkdb.com/apt $DISTRIB_CODENAME main" | sudo tee /etc/apt/sources.list.d/rethinkdb.list
1213
- wget -qO- http://download.rethinkdb.com/apt/pubkey.gpg | sudo apt-key add -
1314
- sudo apt-get update -qq
@@ -17,7 +18,6 @@ dependencies:
1718
- ulimit -S -n 2048
1819
- sleep 10
1920
test:
20-
override:
21-
- npm run ci
2221
post:
22+
- cat coverage/lcov.info | codecov
2323
- sudo killall rethinkdb

mocha.start.js

+39-9
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
'use strict'
33

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

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

11-
var assert = global.assert = JSDataAdapterTests.assert
11+
const assert = global.assert = JSDataAdapterTests.assert
1212
global.sinon = JSDataAdapterTests.sinon
1313

1414
JSDataAdapterTests.init({
@@ -28,16 +28,46 @@ JSDataAdapterTests.init({
2828
]
2929
})
3030

31-
require('./test/handleErrors.test')
31+
describe('RethinkDBAdapter#handleErrors(err)', function () {
32+
it('should do nothing when passed a falsy value', function () {
33+
var Test = this
34+
assert.doesNotThrow(function () {
35+
Test.$$adapter._handleErrors(false)
36+
})
37+
})
38+
it('should do nothing when errors is 0', function () {
39+
var Test = this
40+
assert.doesNotThrow(function () {
41+
Test.$$adapter._handleErrors({
42+
errors: 0
43+
})
44+
})
45+
})
46+
it('should throw an error when errors > 0 && first_error is a string', function () {
47+
var Test = this
48+
var errorString = 'error string'
49+
assert.throws(function () {
50+
Test.$$adapter._handleErrors({
51+
errors: 1,
52+
first_error: errorString
53+
})
54+
}, Error, errorString)
55+
})
56+
it('should throw a generic error when errors > 0 && first_error is nothing', function () {
57+
var Test = this
58+
assert.throws(function () {
59+
Test.$$adapter._handleErrors({
60+
errors: 1
61+
})
62+
}, Error, 'Unknown RethinkDB Error')
63+
})
64+
})
3265

3366
describe('exports', function () {
3467
it('should have correct exports', function () {
35-
assert(JSDataRethinkDB.default)
3668
assert(JSDataRethinkDB.RethinkDBAdapter)
37-
assert(JSDataRethinkDB.RethinkDBAdapter === JSDataRethinkDB.default)
3869
assert(JSDataRethinkDB.OPERATORS)
3970
assert(JSDataRethinkDB.OPERATORS['=='])
4071
assert(JSDataRethinkDB.version)
41-
assert(JSDataRethinkDB.version.full)
4272
})
4373
})

package.json

+15-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "js-data-rethinkdb",
33
"description": "RethinkDB adapter for js-data.",
4-
"version": "3.0.0-beta.4",
4+
"version": "3.0.0-beta.5",
55
"homepage": "https://github.com/js-data/js-data-rethinkdb",
66
"repository": {
77
"type": "git",
@@ -38,22 +38,29 @@
3838
"beforeEach",
3939
"afterEach"
4040
],
41-
"ignore": ["dist/"]
41+
"ignore": [
42+
"dist/"
43+
]
4244
},
4345
"babel": {
44-
"presets": ["es2015-rollup"]
46+
"presets": [
47+
"es2015"
48+
],
49+
"plugins": [
50+
"syntax-async-functions",
51+
"transform-regenerator"
52+
]
4553
},
4654
"scripts": {
4755
"lint": "repo-tools lint \"**/*.js\"",
4856
"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",
4957
"doc": "jsdoc -c conf.json src node_modules/js-data-adapter/src",
5058
"watch": "watch \"npm run bundle\" src/",
5159
"build": "npm run lint && npm run bundle",
52-
"mocha": "mocha -t 30000 -R dot -r source-map-support/register mocha.start.js",
53-
"cover": "istanbul cover --hook-run-in-context node_modules/mocha/bin/_mocha -- -t 30000 -R dot -r source-map-support/register mocha.start.js",
60+
"mocha": "mocha -t 20000 -R dot -r babel-core/register -r babel-polyfill mocha.start.js",
61+
"cover": "nyc --require babel-core/register --require babel-polyfill --cache mocha -t 20000 -R dot mocha.start.js && nyc report --reporter=html",
5462
"test": "npm run build && npm run cover",
55-
"release": "npm test && npm run doc && repo-tools updates && repo-tools changelog && repo-tools authors",
56-
"ci": "npm run test && cat coverage/lcov.info | codecov"
63+
"release": "npm test && npm run doc && repo-tools updates && repo-tools changelog && repo-tools authors"
5764
},
5865
"dependencies": {
5966
"js-data-adapter": "~0.6.1",
@@ -66,9 +73,9 @@
6673
"devDependencies": {
6774
"babel-polyfill": "6.8.0",
6875
"babel-preset-es2015-rollup": "1.1.1",
69-
"istanbul": "0.4.3",
7076
"js-data-adapter-tests": "^2.0.0-alpha.20",
7177
"js-data-repo-tools": "0.5.1",
78+
"nyc": "6.4.4",
7279
"rollup": "0.26.2",
7380
"rollup-plugin-babel": "2.4.0",
7481
"source-map-support": "0.4.0",

rollup.config.js

+4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ module.exports = {
99
],
1010
plugins: [
1111
babel({
12+
babelrc: false,
13+
presets: [
14+
'es2015-rollup'
15+
],
1216
exclude: 'node_modules/**'
1317
})
1418
]

0 commit comments

Comments
 (0)