1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00

chore: add more logging if test-db destroy fails

This commit is contained in:
ivaosthu 2019-10-02 22:23:02 +02:00 committed by Ivar Conradi Østhus
parent 8d63e7e7f5
commit 3e4ab827d3
2 changed files with 23 additions and 5 deletions

View File

@ -54,8 +54,8 @@ module.exports = async function init(databaseSchema = 'test', getLogger) {
const options = {
databaseUrl: require('./database-config').getDatabaseUrl(),
databaseSchema,
minPool: 1,
maxPool: 2,
minPool: 0,
maxPool: 1,
getLogger,
};

View File

@ -32,7 +32,13 @@ module.exports = {
return {
request: supertest.agent(app),
destroy: () => stores.db.destroy(),
destroy: async () => {
try {
await stores.db.destroy();
} catch (error) {
console.error('Failed to destroy db', error);
}
},
};
},
async setupAppWithAuth(name) {
@ -41,7 +47,13 @@ module.exports = {
return {
request: supertest.agent(app),
destroy: () => stores.db.destroy(),
destroy: async () => {
try {
await stores.db.destroy();
} catch (error) {
console.error('Failed to destroy db', error);
}
},
};
},
@ -51,7 +63,13 @@ module.exports = {
return {
request: supertest.agent(app),
destroy: () => stores.db.destroy(),
destroy: async () => {
try {
await stores.db.destroy();
} catch (error) {
console.error('Failed to destroy db', error);
}
},
};
},
};