fix: allow integration tests to run from integration-test/api folder (#940)

This commit is contained in:
Zakaria El Asri
2021-12-16 14:56:25 +01:00
committed by GitHub
parent 8b1b551260
commit 321c271e53
2 changed files with 5 additions and 4 deletions

View File

@@ -13,4 +13,6 @@ module.exports = {
],
transform: { "^.+\\.[jt]s$": `../../jest-transformer.js` },
setupFilesAfterEnv: ["../setup.js"],
globalSetup: "../globalSetup.js",
globalTeardown: "../globalTeardown.js",
}

View File

@@ -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`,