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:
parent
d3fb9f0d09
commit
9fe70f84dc
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user