refactor(modules-sdk): Align configuration and fixes (#9239)
* refactor(modules-sdk): Align configuration and fixes * typo * fix configuration
This commit is contained in:
@@ -129,7 +129,7 @@ describe("Medusa Modules", () => {
|
||||
} as InternalModuleDeclaration,
|
||||
})
|
||||
|
||||
const moduleB = await MedusaModule.bootstrap({
|
||||
await MedusaModule.bootstrap({
|
||||
moduleKey: "moduleKey",
|
||||
defaultPath: "@path",
|
||||
declaration: {
|
||||
@@ -146,7 +146,7 @@ describe("Medusa Modules", () => {
|
||||
})
|
||||
|
||||
it("should return the module flagged as 'main' when multiple instances are available", async () => {
|
||||
const moduleA = await MedusaModule.bootstrap({
|
||||
await MedusaModule.bootstrap({
|
||||
moduleKey: "moduleKey",
|
||||
defaultPath: "@path",
|
||||
declaration: {
|
||||
|
||||
@@ -2,11 +2,6 @@ import { createMedusaContainer } from "@medusajs/utils"
|
||||
import { asFunction, Lifetime } from "awilix"
|
||||
import { moduleProviderLoader } from "../module-provider-loader"
|
||||
|
||||
const logger = {
|
||||
warn: jest.fn(),
|
||||
error: jest.fn(),
|
||||
} as any
|
||||
|
||||
describe("modules loader", () => {
|
||||
let container
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ describe("load internal - load resources", () => {
|
||||
|
||||
const generatedJoinerConfig = (
|
||||
resources.moduleService.prototype as IModuleService
|
||||
).__joinerConfig()
|
||||
).__joinerConfig?.()!
|
||||
|
||||
expect(generatedJoinerConfig).toEqual(
|
||||
expect.objectContaining({
|
||||
@@ -141,7 +141,7 @@ describe("load internal - load resources", () => {
|
||||
|
||||
const generatedJoinerConfig = (
|
||||
resources.moduleService.prototype as IModuleService
|
||||
).__joinerConfig()
|
||||
).__joinerConfig?.()!
|
||||
|
||||
expect(generatedJoinerConfig).toEqual(
|
||||
expect.objectContaining({
|
||||
@@ -221,7 +221,7 @@ describe("load internal - load resources", () => {
|
||||
|
||||
const generatedJoinerConfig = (
|
||||
resources.moduleService.prototype as IModuleService
|
||||
).__joinerConfig()
|
||||
).__joinerConfig?.()!
|
||||
|
||||
expect(generatedJoinerConfig).toEqual({
|
||||
serviceName: "module-without-joiner-config",
|
||||
@@ -296,7 +296,7 @@ describe("load internal - load resources", () => {
|
||||
|
||||
const generatedJoinerConfig = (
|
||||
resources.moduleService.prototype as IModuleService
|
||||
).__joinerConfig()
|
||||
).__joinerConfig?.()!
|
||||
|
||||
expect(generatedJoinerConfig).toEqual({
|
||||
serviceName: "module-service",
|
||||
|
||||
Reference in New Issue
Block a user