Files
medusa-store/integration-tests/modules/__tests__/modules/load-standalone.ts
Adrien de Peretti 0c9018eddc fix: integration tests modules 2 (#6599)
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
2024-03-06 13:26:42 +00:00

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([]))
})
})
},
})