apihub24_token_authentication/test/password.service.mock.ts
2025-08-22 17:46:24 +02:00

27 lines
743 B
TypeScript

import { DynamicModule, Global, Module } from "@nestjs/common";
import { IPasswordService } from "../src";
@Global()
@Module({})
export class PasswordServiceMockModule {
static forRoot(): DynamicModule {
const providers = [
{ provide: "@apihub24/password_service", useClass: PasswordServiceMock },
];
return {
module: PasswordServiceMockModule,
providers: [...providers],
exports: [...providers],
};
}
}
class PasswordServiceMock implements IPasswordService {
hash(plainTextPassword: string): Promise<string> {
throw new Error("Method not implemented.");
}
verify(plainTextPassword: string, passwordHash: string): Promise<boolean> {
throw new Error("Method not implemented.");
}
}