Currently, if the v2 flag is not enabled it can lead to issues if the modules are part of the medusa config as they will get loaded anyway leading to issues if the migrations did not ran
29 lines
859 B
TypeScript
29 lines
859 B
TypeScript
import { medusaIntegrationTestRunner } from "medusa-test-utils"
|
|
|
|
jest.setTimeout(30000)
|
|
|
|
medusaIntegrationTestRunner({
|
|
force_modules_migration: true,
|
|
testSuite: ({ dbConnection }) => {
|
|
describe("Standalone Modules", () => {
|
|
beforeAll(async () => {
|
|
process.env.POSTGRES_URL = dbConnection.manager.connection.options.url
|
|
})
|
|
|
|
afterAll(async () => {
|
|
process.env.POSTGRES_URL = undefined
|
|
})
|
|
|
|
it("Should migrate database and initialize Product module using connection string from environment variable ", async function () {
|
|
const { initialize, runMigrations } = require("@medusajs/product")
|
|
await runMigrations()
|
|
|
|
const product = await initialize()
|
|
const productList = await product.list()
|
|
|
|
expect(productList).toEqual(expect.arrayContaining([]))
|
|
})
|
|
})
|
|
},
|
|
})
|