apihub24_token_authentication/test/group.repository.mock.ts
2025-08-24 14:37:14 +02:00

26 lines
657 B
TypeScript

import { DynamicModule, Global, Module } from "@nestjs/common";
import { IRepository } from "@apihub24/repository";
import { APIHUB24_GROUP_REPOSITORY, IGroup } from "@apihub24/authentication";
@Global()
@Module({})
export class GroupRepositoryMockModule {
static forRoot(): DynamicModule {
const providers = [
{
provide: APIHUB24_GROUP_REPOSITORY,
useValue: {
deleteBy: jest.fn(),
getBy: jest.fn(),
save: jest.fn(),
} as IRepository<IGroup>,
},
];
return {
module: GroupRepositoryMockModule,
providers: [...providers],
exports: [...providers],
};
}
}