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