Skip to content

Commit

Permalink
Closed some open handles that were left after backend jest tests
Browse files Browse the repository at this point in the history
  • Loading branch information
woltsu committed Jul 22, 2019
1 parent fe0b8ea commit 26f517f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion services/backend/oodikone2-backend/test/jest/globals.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const { sequelize } = require('../../src/models/index')
const { sequelizeKone } = require('../../src/models/models_kone')
const { redisClient } = require('../../src/services/redis')
const { forceSyncDatabase } = require('../../src/database/connection')
const { seedAllMigrations } = require('../../src/database/seed_migrations')
Expand All @@ -10,5 +11,7 @@ beforeAll(async () => {

afterAll(async () => {
await sequelize.close()
await redisClient.quitAsync()
await sequelizeKone.close()
// https://stackoverflow.com/a/54560610
await new Promise(res => redisClient.quit(() => setImmediate(res)))
})

0 comments on commit 26f517f

Please sign in to comment.