diff --git a/integration-tests/api/jest.config.js b/integration-tests/api/jest.config.js index caebf0e68a..087b324f1d 100644 --- a/integration-tests/api/jest.config.js +++ b/integration-tests/api/jest.config.js @@ -13,4 +13,6 @@ module.exports = { ], transform: { "^.+\\.[jt]s$": `../../jest-transformer.js` }, setupFilesAfterEnv: ["../setup.js"], + globalSetup: "../globalSetup.js", + globalTeardown: "../globalTeardown.js", } diff --git a/integration-tests/helpers/use-template-db.js b/integration-tests/helpers/use-template-db.js index 32b2699aa7..e9befaa482 100644 --- a/integration-tests/helpers/use-template-db.js +++ b/integration-tests/helpers/use-template-db.js @@ -16,18 +16,17 @@ const pgGodCredentials = { class DatabaseFactory { constructor() { this.connection_ = null - this.masterConnectionName = "name" + this.masterConnectionName = "master" this.templateDbName = "medusa-integration-template" } async createTemplateDb_() { try { + const cwd = path.resolve(path.join(__dirname, "..")) const connection = await this.getMasterConnection() - const migrationDir = path.resolve( path.join( - process.cwd(), - "integration-tests", + cwd, "api", `node_modules`, `@medusajs`,