From d78744efc1d9bc48bc526fa42f14654890b9f8a6 Mon Sep 17 00:00:00 2001 From: openhands Date: Sun, 13 Sep 2026 14:37:33 +0200 Subject: [PATCH] test(utils): add test helper utilities for mocking --- src/actions/test-helpers.ts | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/actions/test-helpers.ts diff --git a/src/actions/test-helpers.ts b/src/actions/test-helpers.ts new file mode 100644 index 00000000..bdb74d4d --- /dev/null +++ b/src/actions/test-helpers.ts @@ -0,0 +1,28 @@ +import { vi } from "vitest"; + +export const createMockDb = () => ({ + insert: vi.fn(), + update: vi.fn(), + delete: vi.fn(), + select: vi.fn(), +}); + +export const createMockAuth = () => ({ + auth: vi.fn(), + handlers: {}, + signOut: vi.fn(), +}); + +export const createMockRcon = () => ({ + disconnectUser: vi.fn(), + giveBadge: vi.fn(), + removeBadge: vi.fn(), + alertUser: vi.fn(), + muteUser: vi.fn(), + unmuteUser: vi.fn(), + giveCredits: vi.fn(), +}); + +export const createMockLogStaffActivity = () => vi.fn(); + +export const createMockRevalidatePath = () => vi.fn();