Skip to content

Commit a12cfff

Browse files
committed
Add README.md for tests
Signed-off-by: Alan Cha <[email protected]>
1 parent c212dcc commit a12cfff

File tree

2 files changed

+36
-2
lines changed

2 files changed

+36
-2
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Tests
2+
3+
We have a number of test suites used to verify the behavior of OpenAPI-to-GraphQL.
4+
5+
### Tests against real-world APIs
6+
7+
The following test suites perform a simple wrapping test and do not make call against any of the respective APIs.
8+
9+
| API | Test file |
10+
|---|---|
11+
| N/A | `cloudfunction.test.ts` |
12+
| [DocuSign](https://www.docusign.com/) | `docusign.test.ts` |
13+
| N/A | `government_social_work.test.ts` |
14+
| [IBM Language Translator](https://www.ibm.com/watson/services/language-translator/) | `ibm_language_translator.test.ts` |
15+
| [Instagram](https://www.instagram.com/) | `instagram.test.ts` |
16+
| [Stripe](https://stripe.com/) | `stripe.test.ts` |
17+
| [Weather Underground](https://www.wunderground.com/) | `weather_underground_test.ts` |
18+
19+
### Tests against custom APIs
20+
21+
We have created a number of example APIs for finer grain testing. Unfortunately, for a number of reasons including difficulty keeping tests on theme and some tests requiring their own specialized APIs, the number of tests have quickly grown and do not have meaningful identifiers.
22+
23+
The following table summarizes the purposes of these tests.
24+
25+
| Test file | API(s) | Testing purpose |
26+
|---|---|---|
27+
| `example_api.test.ts` | `Example API` | An assortment of basic functionality and options on a company-themed API |
28+
| `authentication.test.ts` | `Example API` | Basic authentication tests including using the [viewer functionality](https://github.com/IBM/openapi-to-graphql/blob/master/packages/openapi-to-graphql/README.md#authentication) |
29+
| `example_api2.test.ts` | `Example API 2` | The [`operationIdFieldNames` option](https://github.com/IBM/openapi-to-graphql/blob/master/packages/openapi-to-graphql/README.md#options) |
30+
| `example_api3.test.ts` | `Example API` and `Example API 3` | Creating GraphQL wrappers from multiple APIs and [interOAS links](https://github.com/IBM/openapi-to-graphql/blob/master/packages/openapi-to-graphql/README.md#nested-objects) |
31+
| `example_api4.test.ts` | `Example API 4` | JSON schema [combining schema](https://json-schema.org/understanding-json-schema/reference/combining.html) keywords |
32+
| `example_api5.test.ts` | `Example API 5` | The [`simpleNames` option](https://github.com/IBM/openapi-to-graphql/blob/master/packages/openapi-to-graphql/README.md#options) |
33+
| `example_api6.test.ts` | `Example API 6` | An assortment of other functionality and options |
34+
| `example_api7.test.ts` | `Example API 7` | [Subscription support](../docs/subscriptions.md) |

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ const PORT = 3007
1717
// Update PORT for this test case:
1818
oas.servers[0].variables.port.default = String(PORT)
1919

20+
// Testing the simpleNames option
21+
2022
let createdSchema
2123

2224
/**
@@ -42,8 +44,6 @@ afterAll(() => {
4244
return stopServer()
4345
})
4446

45-
// Testing the simpleNames option
46-
4747
/**
4848
* Because of the simpleNames option, 'o_d_d___n_a_m_e' will not be turned into
4949
* 'oDDNAME'.

0 commit comments

Comments
 (0)