mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
hack to close the dn connection after tests
This commit is contained in:
parent
f8942f048b
commit
1def630e3b
@ -9,10 +9,17 @@ jest.mock('../../config')
|
||||
|
||||
let query: any
|
||||
|
||||
beforeAll(async () => {
|
||||
const { apollo } = await createServer({})
|
||||
// to do: We need a setup for the tests that closes the connection
|
||||
let con: any
|
||||
|
||||
query = createTestClient(apollo).query
|
||||
beforeAll(async () => {
|
||||
const server = await createServer({})
|
||||
con = server.con
|
||||
query = createTestClient(server.apollo).query
|
||||
})
|
||||
|
||||
afterAll(async () => {
|
||||
await con.close()
|
||||
})
|
||||
|
||||
describe('CommunityResolver', () => {
|
||||
|
||||
@ -57,7 +57,7 @@ const createServer = async (context: any = serverContext): Promise<any> => {
|
||||
plugins,
|
||||
})
|
||||
apollo.applyMiddleware({ app })
|
||||
return { apollo, app }
|
||||
return { apollo, app, con }
|
||||
}
|
||||
|
||||
export default createServer
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user