oc-registry-graphql-express-middleware
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -1,6 +0,6 @@ | ||
const fetch = require('node-fetch'); | ||
// const fetch = require('node-fetch'); | ||
const factory = require('../src'); | ||
const options = { | ||
baseUrl: 'http://mock:3000/', | ||
baseUrl: 'https://pink-pineapple.herokuapp.com/', | ||
graphiql: true, | ||
@@ -69,30 +69,8 @@ dependencies: ['graphql', 'lodash', 'moment'] | ||
test.skip('expect res setHeader and end to match snapshot', async () => { | ||
// todo: change mockResponse | ||
fetch.mockResponse(JSON.stringify({ | ||
href: options.baseUrl, | ||
ocVersion: '1.2.3', | ||
type: 'mock-registry', | ||
components: [ | ||
`${options.baseUrl}oc-a-component` | ||
], | ||
name: 'oc-a-component', | ||
description: 'Awesome OpenComponent', | ||
version: '4.5.6', | ||
allVersions: ['4.5.4', '4.5.5', '4.5.6'], | ||
oc: { | ||
parameters: { | ||
id: { | ||
type: 'string', | ||
mandatory: true, | ||
example: '815', | ||
description: 'The Id' | ||
} | ||
} | ||
} | ||
})); | ||
test('expect res setHeader and end to match snapshot', async () => { | ||
const req = { | ||
method: 'GET', | ||
headers: {}, | ||
headers: { | ||
'Content-Type': 'application/json' | ||
}, | ||
url: `?query=${query}` | ||
@@ -105,4 +83,6 @@ }; | ||
expect(res.setHeader).toHaveBeenCalled(); | ||
expect(res.setHeader.mock.calls).toMatchSnapshot(); | ||
expect(res.end.mock.calls).toMatchSnapshot(); | ||
expect(res.end).toHaveBeenCalled(); | ||
expect(JSON.parse(res.end.mock.calls)).toMatchSnapshot(); | ||
}); |
{ | ||
"name": "oc-registry-graphql-express-middleware", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "OpenComponent Registry GraphQL Express middleware.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -0,1 +1,2 @@ | ||
/* | ||
require('isomorphic-fetch'); | ||
@@ -5,1 +6,2 @@ const fetch = require('jest-fetch-mock'); | ||
jest.setMock('node-fetch', fetch); | ||
*/ |
Sorry, the diff of this file is not supported yet
745907
6
384