chore(integration-tests): Normalize DB config + use single process (#2077)

This commit is contained in:
Carlos R. L. Rodrigues
2022-08-24 12:29:53 +02:00
committed by GitHub
parent 687a6badeb
commit 690ca9e89a
15 changed files with 52 additions and 46 deletions
+7 -4
View File
@@ -1,16 +1,19 @@
const path = require("path")
require("dotenv").config({ path: path.join(__dirname, "../.env") })
require("dotenv").config({ path: path.join(__dirname, "../.env.test") })
const { createDatabase, dropDatabase } = require("pg-god")
const { createConnection, getConnection } = require("typeorm")
const DB_USERNAME = process.env.DB_USERNAME || "postgres"
const DB_PASSWORD = process.env.DB_PASSWORD || ""
const DB_URL = `postgres://${DB_USERNAME}:${DB_PASSWORD}@localhost`
const DB_HOST = process.env.DB_HOST
const DB_USERNAME = process.env.DB_USERNAME
const DB_PASSWORD = process.env.DB_PASSWORD
const DB_URL = `postgres://${DB_USERNAME}:${DB_PASSWORD}@${DB_HOST}`
const pgGodCredentials = {
user: DB_USERNAME,
password: DB_PASSWORD,
host: DB_HOST,
}
class DatabaseFactory {