fix: integration-tests/modules (#6595)

This commit is contained in:
Adrien de Peretti
2024-03-06 11:45:34 +00:00
committed by GitHub
parent 51bb6f1e89
commit f0ef0a8784
9 changed files with 50 additions and 55 deletions
@@ -113,26 +113,18 @@ export function moduleIntegrationTestRunner({
} as SuiteOptions
const beforeEach_ = async () => {
try {
await MikroOrmWrapper.setupDatabase()
const output = await initModules(moduleOptions_)
shutdown = output.shutdown
medusaApp = output.medusaApp
moduleService = output.medusaApp.modules[moduleName]
} catch (error) {
console.error("Error setting up database:", error)
}
await MikroOrmWrapper.setupDatabase()
const output = await initModules(moduleOptions_)
shutdown = output.shutdown
medusaApp = output.medusaApp
moduleService = output.medusaApp.modules[moduleName]
}
const afterEach_ = async () => {
try {
await MikroOrmWrapper.clearDatabase()
await shutdown()
moduleService = {}
medusaApp = {} as MedusaAppOutput
} catch (error) {
console.error("Error tearing down database:", error)
}
await MikroOrmWrapper.clearDatabase()
await shutdown()
moduleService = {}
medusaApp = {} as MedusaAppOutput
}
return describe("", () => {