Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions server/src/module/admin/admin.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
21 changes: 12 additions & 9 deletions server/src/module/ats/__tests__/ats.service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
);
}

Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down
Loading