Files
medusa-store/integration-tests/helpers/bootstrap-app.js
Carlos R. L. Rodrigues ffd6234356 chore(integration): throw errors on catch blocks (#2091)
Why:
Suppressing errors and not failing the execution will lead to misleading errors of the following tests.

Fixes CORE-461
2022-08-25 06:36:24 +00:00

31 lines
635 B
JavaScript

const path = require("path")
const express = require("express")
const getPort = require("get-port")
const importFrom = require("import-from")
module.exports = {
bootstrapApp: async ({ cwd } = {}) => {
const app = express()
const loaders = importFrom(
cwd || process.cwd(),
"@medusajs/medusa/dist/loaders"
).default
const { container, dbConnection } = await loaders({
directory: path.resolve(cwd || process.cwd()),
expressApp: app,
isTest: false,
})
const PORT = await getPort()
return {
container,
db: dbConnection,
app,
port: PORT,
}
},
}