diff --git a/.babelrc b/.babelrc index 07af000..c14724b 100644 --- a/.babelrc +++ b/.babelrc @@ -5,7 +5,8 @@ "plugins": [ "transform-export-extensions", "transform-object-assign", - "transform-object-rest-spread" + "transform-object-rest-spread", + ["transform-runtime", { "polyfill": false, "regenerator": true }] ], "sourceMaps": true } \ No newline at end of file diff --git a/package.json b/package.json index 0492ded..dc9aba4 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "babel-plugin-transform-export-extensions": "^6.22.0", "babel-plugin-transform-object-assign": "^6.22.0", "babel-plugin-transform-object-rest-spread": "^6.26.0", - "babel-plugin-transform-runtime": "^6.22.0", + "babel-plugin-transform-runtime": "^6.23.0", "babel-preset-env": "^1.6.1", "babel-preset-es2015-no-commonjs": "0.0.2", "babel-runtime": "^6.26.0", diff --git a/test/connection/test_connection.js b/test/connection/test_connection.js index f9e1e7a..23b866c 100644 --- a/test/connection/test_connection.js +++ b/test/connection/test_connection.js @@ -7,7 +7,7 @@ import { API_PATH } from '../constants' const conn = new Connection(API_PATH) -test('Payload thrown at incorrect API_PATH', t => { +test('Payload thrown at incorrect API_PATH', async t => { const path = 'http://localhost:9984/api/wrong/' const connection = new Connection(path) const target = { @@ -15,10 +15,8 @@ test('Payload thrown at incorrect API_PATH', t => { status: '404 NOT FOUND', requestURI: 'http://localhost:9984/api/wrong/transactions/transactionId' } - connection.getTransaction('transactionId') - .catch(error => { - t.deepEqual(target, error) - }) + const error = await t.throws(connection.getTransaction('transactionId')) + t.deepEqual(target, error) }) test('Generate API URLS', t => {