mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-04 00:18:01 +01:00
debug: test not destroying db in test-setup
This commit is contained in:
parent
a9e215bfca
commit
96d5413b70
@ -9,9 +9,9 @@ const ClientMetricsDb = require('./client-metrics-db');
|
|||||||
const ClientMetricsStore = require('./client-metrics-store');
|
const ClientMetricsStore = require('./client-metrics-store');
|
||||||
const ClientApplicationsStore = require('./client-applications-store');
|
const ClientApplicationsStore = require('./client-applications-store');
|
||||||
|
|
||||||
module.exports.createStores = (config, eventBus) => {
|
module.exports.createStores = (config, eventBus, dbPool) => {
|
||||||
const getLogger = config.getLogger;
|
const getLogger = config.getLogger;
|
||||||
const db = createDb(config);
|
const db = dbPool || createDb(config);
|
||||||
const eventStore = new EventStore(db, getLogger);
|
const eventStore = new EventStore(db, getLogger);
|
||||||
const clientMetricsDb = new ClientMetricsDb(db, getLogger);
|
const clientMetricsDb = new ClientMetricsDb(db, getLogger);
|
||||||
|
|
||||||
|
@ -64,8 +64,8 @@ module.exports = async function init(databaseSchema = 'test', getLogger) {
|
|||||||
|
|
||||||
await db.raw(`CREATE SCHEMA IF NOT EXISTS ${options.databaseSchema}`);
|
await db.raw(`CREATE SCHEMA IF NOT EXISTS ${options.databaseSchema}`);
|
||||||
await migrator(options);
|
await migrator(options);
|
||||||
await db.destroy();
|
// await db.destroy();
|
||||||
const stores = await createStores(options, eventBus);
|
const stores = await createStores(options, eventBus, db);
|
||||||
await resetDatabase(stores);
|
await resetDatabase(stores);
|
||||||
await setupDatabase(stores);
|
await setupDatabase(stores);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user