-
Notifications
You must be signed in to change notification settings - Fork 382
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1482 from randomprofilename/graphql_federation_sc…
…hemahost_fix fix(federation): assignment GraphqlSchemaHost#schema in factory
- Loading branch information
Showing
2 changed files
with
32 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { INestApplication } from '@nestjs/common'; | ||
import { Test } from '@nestjs/testing'; | ||
import { AppModule } from '../graphql-federation/posts-service/federation-posts.module'; | ||
import { GraphQLSchemaHost } from '../../lib'; | ||
import { GraphQLSchema } from 'graphql'; | ||
|
||
describe('GraphQL federation GraphQLSchemaHost using', () => { | ||
let app: INestApplication; | ||
|
||
beforeEach(async () => { | ||
const module = await Test.createTestingModule({ | ||
imports: [AppModule], | ||
}).compile(); | ||
|
||
app = module.createNestApplication(); | ||
await app.init(); | ||
}); | ||
|
||
it(`GraphQLSchemaHost should contain schema`, () => { | ||
const schemaHost = app.get(GraphQLSchemaHost) | ||
|
||
expect(schemaHost.schema).toBeInstanceOf(GraphQLSchema) | ||
}); | ||
|
||
afterEach(async () => { | ||
await app.close(); | ||
}); | ||
}); |