Files
mb-grid-solutions.com/tests/setup.tsx
Marc Mintel 2ca79ee23a
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 4s
Build & Deploy / 🧪 QA (push) Successful in 2m2s
Build & Deploy / 🏗️ Build (push) Failing after 25s
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🩺 Health Check (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 2s
fix: resolve redundant success messages and next/server resolution errors in tests
2026-02-11 14:42:05 +01:00

33 lines
684 B
TypeScript

import "@testing-library/jest-dom/vitest";
import { vi } from "vitest";
// Mock next/navigation
vi.mock("next/navigation", () => ({
usePathname: () => "/",
useRouter: () => ({
push: vi.fn(),
replace: vi.fn(),
prefetch: vi.fn(),
back: vi.fn(),
}),
useSearchParams: () => new URLSearchParams(),
}));
// Mock next-intl to avoid transitive next/server issues
vi.mock("next-intl/middleware", () => ({
default: vi.fn(() => (req: any) => req),
}));
vi.mock("next-intl/server", () => ({
getRequestConfig: vi.fn(),
}));
// Mock next/server
vi.mock("next/server", () => ({
NextResponse: {
json: vi.fn(),
next: vi.fn(),
redirect: vi.fn(),
},
}));