Skip to content

Commit 37d9e0a

Browse files
Alan-ChaErikWittern
authored andcommitted
Clean up fixtures and tests
Signed-off-by: Alan Cha <[email protected]>
1 parent 2039c06 commit 37d9e0a

15 files changed

+68228
-1833
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// Copyright IBM Corp. 2017. All Rights Reserved.
2+
// Node module: openapi-to-graphql
3+
// This file is licensed under the MIT License.
4+
// License text available at https://opensource.org/licenses/MIT
5+
6+
'use strict'
7+
8+
/* globals beforeAll, test, expect */
9+
10+
import * as openAPIToGraphQL from '../lib/index'
11+
const { parse, validate } = require('graphql')
12+
13+
const oas = require('./fixtures/cloudfunction.json')
14+
15+
let createdSchema
16+
17+
beforeAll(async () => {
18+
const { schema } = await openAPIToGraphQL.createGraphQlSchema(oas)
19+
createdSchema = schema
20+
})
21+
22+
test('Get response', async () => {
23+
const query = `mutation {
24+
mutationViewerBasicAuth (username: "test" password: "data") {
25+
postTestAction2 (payloadInput: {age: 27}) {
26+
payload
27+
age
28+
}
29+
}
30+
}`
31+
// validate that 'limit' parameter is covered by options:
32+
const ast = parse(query)
33+
const errors = validate(createdSchema, ast)
34+
expect(errors).toEqual([])
35+
})

packages/openapi-to-graphql/test/docusign.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import * as openAPIToGraphQL from '../lib/index'
1111
import { Options } from '../lib/types/options'
1212

13-
const oas = require('./fixtures/docusign_oas.json')
13+
const oas = require('./fixtures/docusign.json')
1414

1515
test('Generate schema without problems', () => {
1616
const options: Options = {

packages/openapi-to-graphql/test/example_gql_server.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@ const oas = require('./fixtures/example_oas.json')
1616
// const oas3 = require('./fixtures/example_oas3.json')
1717
// const oas4 = require('./fixtures/example_oas4.json')
1818

19-
// const oas = require('./fixtures/github_oas.json')
19+
// const oas = require('./fixtures/github.json')
2020
// const oas = require('./fixtures/instagram.json')
21-
// const oas = require('./fixtures/government_social_work_api.json')
22-
// const oas = require('./fixtures/weather_underground_api.json')
23-
// const oas = require('./fixtures/stripe_oas.json')
21+
// const oas = require('./fixtures/ibm_language_translator.json')
22+
// const oas = require('./fixtures/government_social_work.json')
23+
// const oas = require('./fixtures/weather_underground.json')
24+
// const oas = require('./fixtures/stripe.json')
2425

2526
// const yamljs = require('yamljs')
2627
// const fs = require('fs')

0 commit comments

Comments
 (0)