Files
medusa-store/integration-tests/setup.js
Oliver Windall Juhl 59bb413245 fix: Updating store currencies (#984)
* fix: Adds default currency to store currencies on create

* fix: Adds integration tests + currency update error handling

* add test

* Lowercase currency codes

* fix tests

* fix: Await drop database to stop Jest from complaining

* revert itnegration tests fix

* fix store tests
2022-02-03 20:03:25 +01:00

21 lines
516 B
JavaScript

const path = require("path")
const { dropDatabase } = require("pg-god")
require("dotenv").config({ path: path.join(__dirname, ".env") })
const DB_USERNAME = process.env.DB_USERNAME || "postgres"
const DB_PASSWORD = process.env.DB_PASSWORD || ""
const pgGodCredentials = {
user: DB_USERNAME,
password: DB_PASSWORD,
}
afterAll(async () => {
const workerId = parseInt(process.env.JEST_WORKER_ID || "1")
await dropDatabase(
{ databaseName: `medusa-integration-${workerId}` },
pgGodCredentials
)
})