apihub24_token_authentication/test/right.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_RIGHT_REPOSITORY, IRight } from "@apihub24/authentication";
@Global()
@Module({})
export class RightRepositoryMockModule {
static forRoot(): DynamicModule {
const providers = [
{
provide: APIHUB24_RIGHT_REPOSITORY,
useValue: {
getBy: jest.fn(),
deleteBy: jest.fn(),
save: jest.fn(),
} as IRepository<IRight>,
},
];
return {
module: RightRepositoryMockModule,
providers: [...providers],
exports: [...providers],
};
}
}