fix(medusa-test-utils): Run with modules without models (#9062)

* fix(medusa-test-utils): Run with modules without models

* cleanup

* rm dummy model

* rm dummy model

* improve models loading

* find models

* find models

* find models

* finalize

* cleanup

* fix deps

* fix deps

* fix deps

* fix deps

* fix deps
This commit is contained in:
Adrien de Peretti
2024-09-10 14:22:21 +02:00
committed by GitHub
parent 36f30b4833
commit e56607c97c
6 changed files with 201 additions and 78 deletions

View File

@@ -1,19 +1,11 @@
import { resolve } from "path"
import { moduleIntegrationTestRunner } from "medusa-test-utils"
import { Entity, PrimaryKey } from "@mikro-orm/core"
import { IFileModuleService } from "@medusajs/types"
import { Module, Modules } from "@medusajs/utils"
import { FileModuleService } from "@services"
jest.setTimeout(100000)
// The test runner throws if a model is not passed, so we create a dummy entity
@Entity({ tableName: "dummy_file_entity" })
export default class DummyEntity {
@PrimaryKey()
id: string
}
const moduleOptions = {
providers: [
{
@@ -29,7 +21,6 @@ const moduleOptions = {
moduleIntegrationTestRunner<IFileModuleService>({
moduleName: Modules.FILE,
moduleOptions: moduleOptions,
moduleModels: [DummyEntity],
testSuite: ({ service }) => {
describe("File Module Service", () => {
it(`should export the appropriate linkable configuration`, () => {