forked from Archives/Athou_commafeed
use typesafe mocks
This commit is contained in:
@@ -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(() => {
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user