import { DynamicModule, Global, Module } from "@nestjs/common"; import { IAccount, ISession, ISessionService } from "../src"; @Global() @Module({}) export class SessionServiceMockModule { static forRoot(): DynamicModule { const providers = [ { provide: "@apihub24/session_service", useClass: SessionServiceMock }, ]; return { module: SessionServiceMockModule, providers: [...providers], exports: [...providers], }; } } class SessionServiceMock implements ISessionService { create(account: IAccount): Promise { throw new Error("Method not implemented."); } getBy(filter: (account: IAccount) => boolean): Promise { throw new Error("Method not implemented."); } getById(sessionId: string): Promise { throw new Error("Method not implemented."); } remove(sessionId: string): Promise { throw new Error("Method not implemented."); } }