* init user module events * refactor utils * undo test script update * fix feedback * add eventbus service to module test-runner * add injected dependencies * move events to utils * use const eventname in tests * rm withTransaction
38 lines
834 B
TypeScript
38 lines
834 B
TypeScript
import { Modules, ModulesDefinition } from "@medusajs/modules-sdk"
|
|
|
|
import { DB_URL } from "./database"
|
|
import { MockEventBusService } from "medusa-test-utils"
|
|
|
|
export function getInitModuleConfig() {
|
|
const moduleOptions = {
|
|
defaultAdapterOptions: {
|
|
database: {
|
|
clientUrl: DB_URL,
|
|
schema: process.env.MEDUSA_USER_DB_SCHEMA,
|
|
},
|
|
},
|
|
jwt_secret: "test",
|
|
}
|
|
|
|
const injectedDependencies = {
|
|
eventBusModuleService: new MockEventBusService(),
|
|
}
|
|
|
|
const modulesConfig_ = {
|
|
[Modules.USER]: {
|
|
definition: ModulesDefinition[Modules.USER],
|
|
options: moduleOptions,
|
|
},
|
|
}
|
|
|
|
return {
|
|
injectedDependencies,
|
|
modulesConfig: modulesConfig_,
|
|
databaseConfig: {
|
|
clientUrl: DB_URL,
|
|
schema: process.env.MEDUSA_USER_DB_SCHEMA,
|
|
},
|
|
joinerConfig: [],
|
|
}
|
|
}
|