forked from github/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgraphql.js
More file actions
42 lines (38 loc) · 1.27 KB
/
graphql.js
File metadata and controls
42 lines (38 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import { describe } from '@jest/globals'
import { readFileSync } from 'fs'
import { allVersions } from '../../lib/all-versions.js'
import {
getGraphqlSchema,
getGraphqlChangelog,
getGraphqlBreakingChanges,
getPreviews,
} from '../../src/graphql/lib/index.js'
describe('graphql schema', () => {
const graphqlTypes = JSON.parse(readFileSync('src/graphql/lib/types.json')).map(
(item) => item.kind
)
for (const version in allVersions) {
for (const type of graphqlTypes) {
test(`getting the GraphQL ${type} schema works for ${version}`, async () => {
const schema = getGraphqlSchema(version, type)
expect(schema).toBeDefined()
})
}
}
test('getting the graphql changelog works for dotcom', async () => {
const schema = getGraphqlChangelog('free-pro-team@latest')
expect(schema).toBeDefined()
})
test('getting the graphql breaking changes works for every version', async () => {
for (const version in allVersions) {
const schema = getGraphqlBreakingChanges(version)
expect(schema).toBeDefined()
}
})
test('getting the graphql previews works for every version', async () => {
for (const version in allVersions) {
const schema = getPreviews(version)
expect(schema).toBeDefined()
}
})
})