1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

debug: test not destroying db in test-setup

This commit is contained in:
ivaosthu 2019-10-02 23:11:28 +02:00
parent d3fb9f0d09
commit 9fe70f84dc
2 changed files with 4 additions and 4 deletions

View File

@ -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) => {
module.exports.createStores = (config, eventBus, dbPool) => {
const getLogger = config.getLogger;
const db = createDb(config);
const db = dbPool || createDb(config);
const eventStore = new EventStore(db, getLogger);
const clientMetricsDb = new ClientMetricsDb(db, getLogger);

View File

@ -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);
// await db.destroy();
const stores = await createStores(options, eventBus, db);
await resetDatabase(stores);
await setupDatabase(stores);