fix tests
This commit is contained in:
@ -1,4 +1,6 @@
|
||||
{
|
||||
"extension": ["ts"],
|
||||
"spec": "test/**/*.test.ts"
|
||||
"spec": "test/**/*.test.ts",
|
||||
"require": ["test/global-teardown.ts"],
|
||||
"timeout": 10000
|
||||
}
|
||||
|
||||
@ -81,12 +81,9 @@ export const redisDataSource = new RedisDataSource({
|
||||
const gracefulShutdown = async (signal: string) => {
|
||||
console.log(`Received ${signal}, shutting down gracefully...`)
|
||||
|
||||
try {
|
||||
await redisDataSource.shutdown()
|
||||
console.log('redis shutdown successfully')
|
||||
} catch (error) {
|
||||
console.error('error while shutting down redis', error)
|
||||
}
|
||||
await redisDataSource.shutdown()
|
||||
console.log('redis shutdown successfully')
|
||||
|
||||
process.exit(0)
|
||||
}
|
||||
|
||||
|
||||
5
packages/inbound-email-handler/test/global-teardown.ts
Normal file
5
packages/inbound-email-handler/test/global-teardown.ts
Normal file
@ -0,0 +1,5 @@
|
||||
import { redisDataSource } from '../src/redis_data_source'
|
||||
|
||||
export const mochaGlobalTeardown = async () => {
|
||||
await redisDataSource.shutdown()
|
||||
}
|
||||
Reference in New Issue
Block a user