33 lines
951 B
TypeScript
33 lines
951 B
TypeScript
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<ISession> {
|
|
throw new Error("Method not implemented.");
|
|
}
|
|
getBy(filter: (account: IAccount) => boolean): Promise<ISession[]> {
|
|
throw new Error("Method not implemented.");
|
|
}
|
|
getById(sessionId: string): Promise<ISession | null> {
|
|
throw new Error("Method not implemented.");
|
|
}
|
|
remove(sessionId: string): Promise<void> {
|
|
throw new Error("Method not implemented.");
|
|
}
|
|
}
|