Skip to content

Commit

Permalink
fix: add TypeScript ignore comments for mocked configurations in sear…
Browse files Browse the repository at this point in the history
…ch tests
  • Loading branch information
ThomasGross committed Nov 15, 2024
1 parent c52b5c6 commit 10e51fa
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions __tests__/search.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const facets = {
} as const

beforeEach(() => {
// @ts-ignore
;(goConfig as jest.Mock).mockImplementation((key: string) => {
if (key === "search.item.limit") {
return 9 // Mocked return value for "search.item.limit"
Expand All @@ -49,6 +50,7 @@ beforeEach(() => {

describe("Facet functionality", () => {
it("getMachineNames should return all the facet machine names", () => {
// @ts-ignore
goConfig.mockReturnValue(facets)
const machineNames = getFacetMachineNames()
expect(machineNames).toStrictEqual([
Expand Down Expand Up @@ -109,6 +111,7 @@ describe("Facet functionality", () => {
})

it("getFacetTranslation should give a translated facet when given a facet machine name", () => {
// @ts-ignore
const translation = getFacetTranslation("LIX")
expect(translation).toBe("Lix")
})
Expand Down

0 comments on commit 10e51fa

Please sign in to comment.