import { DynamicModule, Global, Module } from "@nestjs/common"; import { IGroup } from "../src"; import { IRepository } from "@apihub24/repository"; @Global() @Module({}) export class GroupRepositoryMockModule { static forRoot(): DynamicModule { const providers = [ { provide: "@apihub24/group_repository", useClass: GroupRepositoryMock, }, ]; return { module: GroupRepositoryMockModule, providers: [...providers], exports: [...providers], }; } } class GroupRepositoryMock implements IRepository { getBy(filter: (model: IGroup) => boolean): Promise { throw new Error("Method not implemented."); } save(models: IGroup[]): Promise { throw new Error("Method not implemented."); } deleteBy(filter: (model: IGroup) => boolean): Promise { throw new Error("Method not implemented."); } }