From 704c3afc15d6682244f0d317260da44f26538651 Mon Sep 17 00:00:00 2001 From: ivaosthu Date: Wed, 2 Oct 2019 23:14:53 +0200 Subject: [PATCH] Revert "debug: test not destroying db in test-setup" This reverts commit 9fe70f84dc439db03d1604730703b71278547aea. --- lib/db/index.js | 4 ++-- test/e2e/helpers/database-init.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/db/index.js b/lib/db/index.js index a1abd45c08..94ceb67efe 100644 --- a/lib/db/index.js +++ b/lib/db/index.js @@ -9,9 +9,9 @@ const ClientMetricsDb = require('./client-metrics-db'); const ClientMetricsStore = require('./client-metrics-store'); const ClientApplicationsStore = require('./client-applications-store'); -module.exports.createStores = (config, eventBus, dbPool) => { +module.exports.createStores = (config, eventBus) => { const getLogger = config.getLogger; - const db = dbPool || createDb(config); + const db = createDb(config); const eventStore = new EventStore(db, getLogger); const clientMetricsDb = new ClientMetricsDb(db, getLogger); diff --git a/test/e2e/helpers/database-init.js b/test/e2e/helpers/database-init.js index 5662829173..cc356eb99f 100644 --- a/test/e2e/helpers/database-init.js +++ b/test/e2e/helpers/database-init.js @@ -64,8 +64,8 @@ module.exports = async function init(databaseSchema = 'test', getLogger) { await db.raw(`CREATE SCHEMA IF NOT EXISTS ${options.databaseSchema}`); await migrator(options); - // await db.destroy(); - const stores = await createStores(options, eventBus, db); + await db.destroy(); + const stores = await createStores(options, eventBus); await resetDatabase(stores); await setupDatabase(stores);