fix(test): make chart tests working

This commit is contained in:
syuilo
2022-06-05 20:37:24 +09:00
parent 09b749eb97
commit d17298d3b5
3 changed files with 65 additions and 53 deletions

View File

@@ -208,7 +208,15 @@ export const db = new DataSource({
migrations: ['../../migration/*.js'],
});
export async function initDb() {
export async function initDb(force = false) {
if (force) {
if (db.isInitialized) {
await db.destroy();
}
await db.initialize();
return;
}
if (db.isInitialized) {
// nop
} else {