import { DynamicModule, Global, Module } from "@nestjs/common"; import { IRepository } from "@apihub24/repository"; import { APIHUB24_ORGANIZATION_REPOSITORY, IOrganization, } from "@apihub24/authentication"; @Global() @Module({}) export class OrganizationRepositoryMockModule { static forRoot(): DynamicModule { const providers = [ { provide: APIHUB24_ORGANIZATION_REPOSITORY, useValue: { deleteBy: jest.fn(), getBy: jest.fn(), save: jest.fn(), } as IRepository, }, ]; return { module: OrganizationRepositoryMockModule, providers: [...providers], exports: [...providers], }; } }