29 lines
641 B
TypeScript
29 lines
641 B
TypeScript
import { DynamicModule, Global, Module } from "@nestjs/common";
|
|
import {
|
|
APIHUB24_SESSION_SERVICE,
|
|
ISessionService,
|
|
} from "@apihub24/authentication";
|
|
|
|
@Global()
|
|
@Module({})
|
|
export class SessionServiceMockModule {
|
|
static forRoot(): DynamicModule {
|
|
const providers = [
|
|
{
|
|
provide: APIHUB24_SESSION_SERVICE,
|
|
useValue: {
|
|
create: jest.fn(),
|
|
getBy: jest.fn(),
|
|
getById: jest.fn(),
|
|
remove: jest.fn(),
|
|
} as ISessionService,
|
|
},
|
|
];
|
|
return {
|
|
module: SessionServiceMockModule,
|
|
providers: [...providers],
|
|
exports: [...providers],
|
|
};
|
|
}
|
|
}
|