1
0
mirror of synced 2025-12-23 21:07:12 -05:00

move graphql tests (#36475)

This commit is contained in:
Rachael Sewell
2023-04-18 16:42:14 -07:00
committed by GitHub
parent 18aa3052e7
commit d49f1dab22
8 changed files with 21 additions and 20 deletions

View File

@@ -43,9 +43,9 @@ jobs:
// repos.
return [
{ name: 'content', path: 'tests/content', },
{ name: 'graphql', path: 'tests/graphql', },
{ name: 'events', path: 'src/events/tests', },
{ name: 'automated-pipelines', path: 'src/automated-pipelines/tests', },
{ name: 'events', path: 'src/events/tests', },
{ name: 'graphql', path: 'src/graphql/tests', },
{ name: 'rest', path: 'src/rest/tests', },
{ name: 'webhooks', path: 'src/webhooks/tests', },
{ name: 'linting', path: 'tests/linting', },

View File

@@ -1,15 +1,19 @@
import yaml from 'js-yaml'
import fs from 'fs/promises'
import MockDate from 'mockdate'
import {
createChangelogEntry,
cleanPreviewTitle,
previewAnchor,
prependDatedEntry,
} from '../../src/graphql/scripts/build-changelog.js'
import fs from 'fs/promises'
import MockDate from 'mockdate'
import readJsonFile from '../../lib/read-json-file.js'
const expectedChangelogEntry = readJsonFile('./tests/fixtures/changelog-entry.json')
const expectedUpdatedChangelogFile = readJsonFile('./tests/fixtures/updated-changelog-file.json')
} from '../scripts/build-changelog.js'
import readJsonFile from '../../../lib/read-json-file.js'
const expectedChangelogEntry = readJsonFile('src/graphql/tests/fixtures/changelog-entry.json')
const expectedUpdatedChangelogFile = readJsonFile(
'src/graphql/tests/fixtures/updated-changelog-file.json'
)
describe('creating a changelog from old schema and new schema', () => {
afterEach(() => {
@@ -124,7 +128,7 @@ describe('updating the changelog file', () => {
})
it('modifies the entry object and the file on disk', async () => {
const testTargetPath = 'tests/graphql/example_changelog.json'
const testTargetPath = 'src/graphql/tests/fixtures/example-changelog.json'
const previousContents = await fs.readFile(testTargetPath)
const exampleEntry = { someStuff: true }

View File

@@ -1,12 +1,13 @@
import { describe } from '@jest/globals'
import { readFileSync } from 'fs'
import { allVersions } from '../../lib/all-versions.js'
import { allVersions } from '../../../lib/all-versions.js'
import {
getGraphqlSchema,
getGraphqlChangelog,
getGraphqlBreakingChanges,
getPreviews,
} from '../../src/graphql/lib/index.js'
} from '../lib/index.js'
describe('graphql schema', () => {
const graphqlTypes = JSON.parse(readFileSync('src/graphql/lib/types.json')).map(

View File

@@ -1,15 +1,11 @@
import { jest } from '@jest/globals'
import Ajv from 'ajv'
import readJsonFile from '../../lib/read-json-file.js'
import {
schemaValidator,
previewsValidator,
upcomingChangesValidator,
} from '../../src/graphql/lib/validator.js'
import { formatAjvErrors } from '../helpers/schemas.js'
import { allVersions } from '../../lib/all-versions.js'
import { GRAPHQL_DATA_DIR } from '../../src/graphql/lib/index.js'
import readJsonFile from '../../../lib/read-json-file.js'
import { schemaValidator, previewsValidator, upcomingChangesValidator } from '../lib/validator.js'
import { formatAjvErrors } from '../../../tests/helpers/schemas.js'
import { allVersions } from '../../../lib/all-versions.js'
import { GRAPHQL_DATA_DIR } from '../lib/index.js'
const allVersionValues = Object.values(allVersions)
const graphqlVersions = allVersionValues.map((v) => v.miscVersionName)