Skip to content

Commit

Permalink
fix: build
Browse files Browse the repository at this point in the history
This removes the export of Options as they no longer exist and so were a
bug to be exporting.
  • Loading branch information
jasonkuhrt committed May 28, 2020
1 parent b69791c commit a6e8e0a
Show file tree
Hide file tree
Showing 5 changed files with 1,642 additions and 2,401 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ jobs:
steps:
- checkout
- run: yarn install
- run: yarn test
- run: yarn test:ci
- run: npx semantic-release
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@
"prepublish": "npm run build",
"build": "rm -rf dist && tsc -d",
"lint": "tslint --project . {examples,src,test}/**/*.ts",
"test": "npm run lint && npm run build && ava --serial && npm run size",
"size": "bundlesize"
"test": "yarn lint && yarn build && ava --serial",
"test:ci": "yarn test && bundlesize"
},
"dependencies": {},
"devDependencies": {
"@types/fetch-mock": "5.12.2",
"@types/node": "8.5.5",
"ava": "0.25.0",
"bundlesize": "0.17.0",
"ava": "^3.8.2",
"bundlesize": "^0.18.0",
"fetch-cookie": "0.7.2",
"fetch-mock": "5.13.1",
"prettier": "1.14.2",
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { ClientError, GraphQLError, Variables } from './types'

export { ClientError, Options } from './types'
export { ClientError } from './types'

export class GraphQLClient {
private url: string
Expand Down
12 changes: 6 additions & 6 deletions tests/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import test from 'ava'
import * as fetchMock from 'fetch-mock'

import { ClientError, rawRequest, request, GraphQLClient } from '../src/index'
import { ClientError, GraphQLClient, rawRequest, request } from '../src/index'

test('minimal query', async (t) => {
const data = {
Expand Down Expand Up @@ -77,8 +76,10 @@ test('basic error', async (t) => {
],
}

await mock({body: {errors}}, async () => {
const err: ClientError = await t.throws(request('https://mock-api.com/graphql', `x`), ClientError)
await mock({ body: { errors } }, async () => {
const err = await t.throwsAsync<ClientError>(
request('https://mock-api.com/graphql', `x`),
)
t.deepEqual<any>(err.response.errors, errors)
})
})
Expand All @@ -96,9 +97,8 @@ test('raw request error', async (t) => {
}

await mock({ body: { errors } }, async () => {
const err: ClientError = await t.throws(
const err = await t.throwsAsync<ClientError>(
rawRequest('https://mock-api.com/graphql', `x`),
ClientError
)
t.deepEqual<any>(err.response.errors, errors)
})
Expand Down
Loading

0 comments on commit a6e8e0a

Please sign in to comment.