Chore/integration tests modules utils (#6581)

new wrapper for medusa integration tests.
for now it is only applied to the modules directory, but it could be used in the api integration tests or any other integrations that requires a db and a server up and running. 

It is not perfect, but I wanted to have something working and centralised before improving it, also avoiding too many conflicts with other prs
This commit is contained in:
Adrien de Peretti
2024-03-06 11:03:07 +01:00
committed by GitHub
parent a6736c7ee0
commit 51bb6f1e89
99 changed files with 10164 additions and 10303 deletions

View File

@@ -4,9 +4,13 @@ import jwt from "jsonwebtoken"
import { getContainer } from "../../environment-helpers/use-container"
import adminSeeder from "../../helpers/admin-seeder"
export const createAdminUser = async (dbConnection, adminHeaders) => {
export const createAdminUser = async (
dbConnection,
adminHeaders,
container?
) => {
await adminSeeder(dbConnection)
const appContainer = getContainer()!
const appContainer = container ?? getContainer()!
const authModule: IAuthModuleService = appContainer.resolve(
ModuleRegistrationName.AUTH