move graphql tests (#36475)
This commit is contained in:
4
.github/workflows/test.yml
vendored
4
.github/workflows/test.yml
vendored
@@ -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', },
|
||||
|
||||
@@ -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 }
|
||||
@@ -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(
|
||||
@@ -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)
|
||||
Reference in New Issue
Block a user