fix tests
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
import { env } from '../src/env'
|
||||
import { redisClient } from '../src/redis'
|
||||
import { createTestConnection } from './db'
|
||||
import { startApolloServer } from './util'
|
||||
|
||||
@ -5,6 +7,11 @@ export const mochaGlobalSetup = async () => {
|
||||
await createTestConnection()
|
||||
console.log('db connection created')
|
||||
|
||||
if (env.redis.url) {
|
||||
await redisClient.connect()
|
||||
console.log('redis connection created')
|
||||
}
|
||||
|
||||
await startApolloServer()
|
||||
console.log('apollo server started')
|
||||
}
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
import { appDataSource } from '../src/data_source'
|
||||
import { env } from '../src/env'
|
||||
import { redisClient } from '../src/redis'
|
||||
import { stopApolloServer } from './util'
|
||||
|
||||
export const mochaGlobalTeardown = async () => {
|
||||
@ -7,4 +9,9 @@ export const mochaGlobalTeardown = async () => {
|
||||
|
||||
await appDataSource.destroy()
|
||||
console.log('db connection closed')
|
||||
|
||||
if (env.redis.url) {
|
||||
await redisClient.disconnect()
|
||||
console.log('redis connection closed')
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user