diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2022-05-21 22:07:01 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2022-05-21 22:07:01 +0900 |
| commit | 425084b596edd4aae5736031039f2fc2f4cb05dd (patch) | |
| tree | 3821d772e336ef8f51a884b49236269c5190d12b | |
| parent | Update utils.ts (diff) | |
| download | misskey-425084b596edd4aae5736031039f2fc2f4cb05dd.tar.gz misskey-425084b596edd4aae5736031039f2fc2f4cb05dd.tar.bz2 misskey-425084b596edd4aae5736031039f2fc2f4cb05dd.zip | |
Update utils.ts
| -rw-r--r-- | packages/backend/test/utils.ts | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/packages/backend/test/utils.ts b/packages/backend/test/utils.ts index e900746be9..4e98f13328 100644 --- a/packages/backend/test/utils.ts +++ b/packages/backend/test/utils.ts @@ -159,7 +159,7 @@ export function launchServer(callbackSpawnedProcess: (p: childProcess.ChildProce export async function initTestDb(justBorrow = false, initEntities?: any[]) { if (process.env.NODE_ENV !== 'test') throw 'NODE_ENV is not a test'; - return new DataSource({ + const db = new DataSource({ type: 'postgres', host: config.db.host, port: config.db.port, @@ -170,6 +170,10 @@ export async function initTestDb(justBorrow = false, initEntities?: any[]) { dropSchema: true && !justBorrow, entities: initEntities || entities, }); + + await db.initialize(); + + return db; } export function startServer(timeout = 30 * 1000): Promise<childProcess.ChildProcess> { |