diff --git a/server/src/module/admin/admin.controller.ts b/server/src/module/admin/admin.controller.ts index 93a57842e..2c43065b5 100644 --- a/server/src/module/admin/admin.controller.ts +++ b/server/src/module/admin/admin.controller.ts @@ -7,6 +7,7 @@ import { clearCache } from "../../middleware/cache.middleware.js"; import { cacheDelPattern } from "../../utils/cache.js"; import { withAdvisoryLock } from "../../utils/cron-lock.js"; +// Admin controller class to handle administrative operations const logger = createLogger("AdminController"); import { adminLoginSchema, diff --git a/server/src/module/ats/__tests__/ats.service.test.ts b/server/src/module/ats/__tests__/ats.service.test.ts index 5e9148aee..1dc24c963 100644 --- a/server/src/module/ats/__tests__/ats.service.test.ts +++ b/server/src/module/ats/__tests__/ats.service.test.ts @@ -106,11 +106,12 @@ function mockCacheMiss() { function mockValidPdf(text = VALID_RESUME_TEXT) { vi.mocked(PDFParse).mockImplementation( - () => - ({ + function () { + return { getText: vi.fn().mockResolvedValue({ text }), destroy: vi.fn().mockResolvedValue(undefined), - }) as any, + } as any; + } ); } @@ -183,11 +184,12 @@ describe("AtsService", () => { mockUserOwnsResume(); mockCacheMiss(); vi.mocked(PDFParse).mockImplementation( - () => - ({ + function () { + return { getText: vi.fn().mockResolvedValue({ text: "too short" }), destroy: vi.fn().mockResolvedValue(undefined), - }) as any, + } as any; + } ); await expect( @@ -466,11 +468,12 @@ describe("AtsService", () => { it("throws when PDF text extraction yields insufficient content", async () => { mockUserOwnsResume(); vi.mocked(PDFParse).mockImplementation( - () => - ({ + function () { + return { getText: vi.fn().mockResolvedValue({ text: "tiny" }), destroy: vi.fn().mockResolvedValue(undefined), - }) as any, + } as any; + } ); await expect(