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
|
// API
|
||||||
|
process.chdir(__dirname)
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: "api",
|
name: "api",
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
const dbFactory = require("./helpers/use-template-db")
|
const dbFactory = require("./helpers/use-template-db")
|
||||||
|
const path = require("path")
|
||||||
|
|
||||||
module.exports = async () => {
|
module.exports = async () => {
|
||||||
await dbFactory.createTemplateDb_()
|
await dbFactory.createTemplateDb_({ cwd: path.resolve(".") })
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,14 +20,13 @@ class DatabaseFactory {
|
|||||||
this.templateDbName = "medusa-integration-template"
|
this.templateDbName = "medusa-integration-template"
|
||||||
}
|
}
|
||||||
|
|
||||||
async createTemplateDb_() {
|
async createTemplateDb_({ cwd }) {
|
||||||
try {
|
try {
|
||||||
const cwd = path.resolve(path.join(__dirname, ".."))
|
// const cwd = path.resolve(path.join(__dirname, ".."))
|
||||||
const connection = await this.getMasterConnection()
|
const connection = await this.getMasterConnection()
|
||||||
const migrationDir = path.resolve(
|
const migrationDir = path.resolve(
|
||||||
path.join(
|
path.join(
|
||||||
cwd,
|
cwd,
|
||||||
"api",
|
|
||||||
`node_modules`,
|
`node_modules`,
|
||||||
`@medusajs`,
|
`@medusajs`,
|
||||||
`medusa`,
|
`medusa`,
|
||||||
|
|||||||
Reference in New Issue
Block a user