fix: make sure @medusajs/medusa is loaded correctly regardless of integration test suite being run (#1166)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
// API
|
||||
process.chdir(__dirname)
|
||||
|
||||
module.exports = {
|
||||
name: "api",
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
const dbFactory = require("./helpers/use-template-db")
|
||||
const path = require("path")
|
||||
|
||||
module.exports = async () => {
|
||||
await dbFactory.createTemplateDb_()
|
||||
await dbFactory.createTemplateDb_({ cwd: path.resolve(".") })
|
||||
}
|
||||
|
||||
@@ -20,14 +20,13 @@ class DatabaseFactory {
|
||||
this.templateDbName = "medusa-integration-template"
|
||||
}
|
||||
|
||||
async createTemplateDb_() {
|
||||
async createTemplateDb_({ cwd }) {
|
||||
try {
|
||||
const cwd = path.resolve(path.join(__dirname, ".."))
|
||||
// const cwd = path.resolve(path.join(__dirname, ".."))
|
||||
const connection = await this.getMasterConnection()
|
||||
const migrationDir = path.resolve(
|
||||
path.join(
|
||||
cwd,
|
||||
"api",
|
||||
`node_modules`,
|
||||
`@medusajs`,
|
||||
`medusa`,
|
||||
|
||||
Reference in New Issue
Block a user