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

29 lines
674 B
TypeScript

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