mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
fix tests
This commit is contained in:
parent
32a58e49f9
commit
f4ff4b9fcd
2 changed files with 14 additions and 0 deletions
|
|
@ -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')
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue