From a19ca008e45d6a941776e854bb6bd6b1b3efc3a6 Mon Sep 17 00:00:00 2001 From: Anas Barghoud Date: Wed, 30 Oct 2024 22:42:14 +0100 Subject: [PATCH] Fix lint and test issues --- apps/api/src/app/generate.controller.spec.ts | 7 ++++++- libs/recaptcha/contracts/vite.config.ts | 1 + libs/recaptcha/google/src/lib/local-recaptcha-checker.ts | 1 + libs/recaptcha/google/vite.config.ts | 1 + 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/apps/api/src/app/generate.controller.spec.ts b/apps/api/src/app/generate.controller.spec.ts index 736123c..bb38a5f 100644 --- a/apps/api/src/app/generate.controller.spec.ts +++ b/apps/api/src/app/generate.controller.spec.ts @@ -4,6 +4,8 @@ import { mock } from 'jest-mock-extended'; import { GenerateController } from './generate.controller'; import { PPSProfileDto } from './pps/domain/pps-profile-dto.model'; import { IPPSGenerateUseCase, IPPSGenerateUseCaseSymbol } from './pps/usecase/pps-generate-usecase.interface'; +import { IRecaptchaCheckerSymbol } from '@pps-easy/recaptcha/contracts'; +import { LocalRecaptchaChecker } from '@pps-easy/recaptcha/google'; describe('The GenerateController class', () => { let app: TestingModule; @@ -12,7 +14,10 @@ describe('The GenerateController class', () => { beforeAll(async () => { app = await Test.createTestingModule({ controllers: [GenerateController], - providers: [{ provide: IPPSGenerateUseCaseSymbol, useValue: ppsGeneratorUseCase }], + providers: [ + { provide: IPPSGenerateUseCaseSymbol, useValue: ppsGeneratorUseCase }, + { provide: IRecaptchaCheckerSymbol, useClass: LocalRecaptchaChecker }, + ], }).compile(); }); diff --git a/libs/recaptcha/contracts/vite.config.ts b/libs/recaptcha/contracts/vite.config.ts index b2c686c..d2c2060 100644 --- a/libs/recaptcha/contracts/vite.config.ts +++ b/libs/recaptcha/contracts/vite.config.ts @@ -12,6 +12,7 @@ export default defineConfig({ // plugins: [ nxViteTsPaths() ], // }, test: { + passWithNoTests: true, watch: false, globals: true, environment: 'node', diff --git a/libs/recaptcha/google/src/lib/local-recaptcha-checker.ts b/libs/recaptcha/google/src/lib/local-recaptcha-checker.ts index 760a5c0..2a2e64b 100644 --- a/libs/recaptcha/google/src/lib/local-recaptcha-checker.ts +++ b/libs/recaptcha/google/src/lib/local-recaptcha-checker.ts @@ -4,6 +4,7 @@ import { } from '@pps-easy/recaptcha/contracts'; export class LocalRecaptchaChecker implements IRecaptchaChecker { + // eslint-disable-next-line @typescript-eslint/no-unused-vars public check(token: string): Promise { return Promise.resolve({ score: 1, isValid: true, reasons: [] }); } diff --git a/libs/recaptcha/google/vite.config.ts b/libs/recaptcha/google/vite.config.ts index 457c29d..c86a7da 100644 --- a/libs/recaptcha/google/vite.config.ts +++ b/libs/recaptcha/google/vite.config.ts @@ -12,6 +12,7 @@ export default defineConfig({ // plugins: [ nxViteTsPaths() ], // }, test: { + passWithNoTests: true, watch: false, globals: true, environment: 'node',