add test per permutation for graphql tests (#38340)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user