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