-
Notifications
You must be signed in to change notification settings - Fork 331
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Improve and refactor tests * Fix leak
- Loading branch information
Showing
28 changed files
with
267 additions
and
238 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { join } from 'path'; | ||
import { findAndParseConfig } from '@graphql-mesh/cli'; | ||
import { getMesh, MeshInstance } from '@graphql-mesh/runtime'; | ||
import { printSchemaWithDirectives } from '@graphql-tools/utils'; | ||
|
||
jest.setTimeout(15000); | ||
|
||
describe('FHIR', () => { | ||
let mesh: MeshInstance; | ||
beforeAll(async () => { | ||
const config = await findAndParseConfig({ | ||
dir: join(__dirname, '..'), | ||
}); | ||
mesh = await getMesh(config); | ||
}); | ||
it('should generate correct schema', async () => { | ||
expect(printSchemaWithDirectives(mesh.schema)).toMatchSnapshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,35 @@ | ||
import { basename, join } from 'path'; | ||
import { introspectionFromSchema, lexicographicSortSchema } from 'graphql'; | ||
import { findAndParseConfig } from '@graphql-mesh/cli'; | ||
import { getMesh } from '@graphql-mesh/runtime'; | ||
import { getMesh, MeshInstance } from '@graphql-mesh/runtime'; | ||
import { ProcessedConfig } from '../../../packages/legacy/config/dist/typings/process'; | ||
|
||
const config$ = findAndParseConfig({ | ||
dir: join(__dirname, '..'), | ||
}); | ||
const mesh$ = config$.then(config => getMesh(config)); | ||
jest.setTimeout(15000); | ||
|
||
describe('OData TripPin', () => { | ||
let config: ProcessedConfig; | ||
let mesh: MeshInstance; | ||
beforeAll(async () => { | ||
config = await findAndParseConfig({ | ||
dir: join(__dirname, '..'), | ||
}); | ||
mesh = await getMesh(config); | ||
}); | ||
it('should generate correct schema', async () => { | ||
const { schema } = await mesh$; | ||
expect( | ||
introspectionFromSchema(lexicographicSortSchema(schema), { | ||
introspectionFromSchema(lexicographicSortSchema(mesh.schema), { | ||
descriptions: false, | ||
}), | ||
).toMatchSnapshot('odata-trippin-schema'); | ||
}); | ||
it('should give correct response for example queries', async () => { | ||
const { documents } = await config$; | ||
const { execute } = await mesh$; | ||
for (const source of documents) { | ||
for (const source of config.documents) { | ||
if (!source.document || !source.location) { | ||
continue; | ||
} | ||
const result = await execute(source.document, {}); | ||
const result = await mesh.execute(source.document, {}); | ||
expect(result).toMatchSnapshot(basename(source.location) + '-query-result'); | ||
} | ||
}); | ||
afterAll(() => mesh$.then(mesh => mesh.destroy())); | ||
afterAll(() => mesh?.destroy()); | ||
}); |
File renamed without changes.
Oops, something went wrong.