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