use typesafe mocks

This commit is contained in:
Athou
2025-03-02 19:18:51 +01:00
parent 4ecefe6491
commit 706bad26f1
2 changed files with 3 additions and 3 deletions

View File

@@ -6,7 +6,7 @@ import type { Entries, Entry } from "app/types"
import type { AxiosResponse } from "axios"
import { beforeEach, describe, expect, it, vi } from "vitest"
vi.mock("app/client")
vi.mock(import("app/client"))
describe("entries", () => {
beforeEach(() => {

View File

@@ -5,12 +5,12 @@ import { useActionButton } from "hooks/useActionButton"
import { describe, expect, it, vi } from "vitest"
import { ActionButton } from "./ActionButton"
vi.mock("@lingui/react", () => ({
vi.mock(import("@lingui/react"), () => ({
useLingui: vi.fn().mockReturnValue({
_: msg => msg,
} as I18nContext),
}))
vi.mock("hooks/useActionButton")
vi.mock(import("hooks/useActionButton"))
const label = "Test Label"
const icon = "Test Icon"