Skip to content

Commit e520456

Browse files
committed
Prepare for 3.0.0-beta.5
1 parent fd53d89 commit e520456

File tree

7 files changed

+59
-64
lines changed

7 files changed

+59
-64
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,5 @@ bower_components/
3434
*.iml
3535

3636
rethinkdb_data/
37-
doc/
37+
doc/
38+
.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

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

+9-5
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",
@@ -44,7 +44,11 @@
4444
},
4545
"babel": {
4646
"presets": [
47-
"es2015-rollup"
47+
"es2015"
48+
],
49+
"plugins": [
50+
"syntax-async-functions",
51+
"transform-regenerator"
4852
]
4953
},
5054
"scripts": {
@@ -53,8 +57,8 @@
5357
"doc": "jsdoc -c conf.json src node_modules/js-data-adapter/src",
5458
"watch": "watch \"npm run bundle\" src/",
5559
"build": "npm run lint && npm run bundle",
56-
"mocha": "mocha -t 30000 -R dot -r source-map-support/register mocha.start.js",
57-
"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",
5862
"test": "npm run build && npm run cover",
5963
"release": "npm test && npm run doc && repo-tools updates && repo-tools changelog && repo-tools authors"
6064
},
@@ -69,9 +73,9 @@
6973
"devDependencies": {
7074
"babel-polyfill": "6.8.0",
7175
"babel-preset-es2015-rollup": "1.1.1",
72-
"istanbul": "0.4.3",
7376
"js-data-adapter-tests": "^2.0.0-alpha.20",
7477
"js-data-repo-tools": "0.5.1",
78+
"nyc": "6.4.4",
7579
"rollup": "0.26.2",
7680
"rollup-plugin-babel": "2.4.0",
7781
"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
]

src/index.js

-14
Original file line numberDiff line numberDiff line change
@@ -1025,18 +1025,6 @@ export const version = '<%= version %>'
10251025
* @type {Constructor}
10261026
*/
10271027

1028-
/**
1029-
* {@link RethinkDBAdapter} class.
1030-
*
1031-
* @example <caption>ES2015 modules "default" import</caption>
1032-
* import RethinkDBAdapter from 'js-data-rethinkdb'
1033-
* const adapter = new RethinkDBAdapter()
1034-
*
1035-
* @name module:js-data-rethinkdb.default
1036-
* @see RethinkDBAdapter
1037-
* @type {Constructor}
1038-
*/
1039-
10401028
/**
10411029
* Registered as `js-data-rethinkdb` in NPM.
10421030
*
@@ -1053,5 +1041,3 @@ export const version = '<%= version %>'
10531041
*
10541042
* @module js-data-rethinkdb
10551043
*/
1056-
1057-
export default RethinkDBAdapter

test/handleErrors.test.js

-35
This file was deleted.

0 commit comments

Comments
 (0)