mirror of
https://github.com/gethomepage/homepage.git
synced 2026-02-07 16:30:52 +08:00
Add some auth tests
This commit is contained in:
@@ -8,6 +8,12 @@ afterEach(() => {
|
||||
if (typeof document !== "undefined") cleanup();
|
||||
});
|
||||
|
||||
// Avoid NextAuth client-side fetches during unit tests.
|
||||
vi.mock("next-auth/react", () => ({
|
||||
SessionProvider: ({ children }) => children ?? null,
|
||||
getProviders: vi.fn(async () => ({})),
|
||||
}));
|
||||
|
||||
// implement a couple of common formatters mocked in next-i18next
|
||||
vi.mock("next-i18next", () => ({
|
||||
// Keep app/page components importable in unit tests.
|
||||
|
||||
Reference in New Issue
Block a user