1
0
mirror of synced 2025-12-25 02:17:36 -05:00

add test per permutation for graphql tests (#38340)

This commit is contained in:
Rachael Sewell
2023-06-22 15:24:55 -07:00
committed by GitHub
parent 675a54972a
commit 24d5323a51

View File

@@ -24,15 +24,15 @@ graphqlTypes.forEach((type) => {
describe('graphql json files', () => {
jest.setTimeout(3 * 60 * 1000)
test('schemas object validation', () => {
// The typeObj is repeated thousands of times in each .json file
// so use a cache of which we've already validated to speed this
// test up significantly.
const typeObjsTested = new Set()
graphqlVersions.forEach((version) => {
const schemaJsonPerVersion = readJsonFile(`${GRAPHQL_DATA_DIR}/${version}/schema.json`)
// all graphql types are arrays except for queries
graphqlTypes.forEach((type) => {
// The typeObj is repeated thousands of times in each .json file
// so use a cache of which we've already validated to speed this
// test up significantly.
const typeObjsTested = new Set()
graphqlVersions.forEach((version) => {
const schemaJsonPerVersion = readJsonFile(`${GRAPHQL_DATA_DIR}/${version}/schema.json`)
// all graphql types are arrays except for queries
graphqlTypes.forEach((type) => {
test(`${version} schemas object validation for ${type}`, () => {
schemaJsonPerVersion[type].forEach((typeObj) => {
const key = JSON.stringify(typeObj) + type
if (typeObjsTested.has(key)) return