From 2c1752f178acfe0612ac9d972d3af564d0a5d890 Mon Sep 17 00:00:00 2001 From: "groombook-engineer[bot]" <3141748+groombook-engineer[bot]@users.noreply.github.com> Date: Fri, 3 Apr 2026 11:41:33 +0000 Subject: [PATCH] test(authProvider): mock reinitAuth to prevent BETTER_AUTH_SECRET dependency vi.mock the auth module so reinitAuth() is a no-op in tests. This decouples the tests from the BETTER_AUTH_SECRET env var. Co-Authored-By: Paperclip --- apps/api/src/__tests__/authProvider.test.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/api/src/__tests__/authProvider.test.ts b/apps/api/src/__tests__/authProvider.test.ts index 8611635..c09754d 100644 --- a/apps/api/src/__tests__/authProvider.test.ts +++ b/apps/api/src/__tests__/authProvider.test.ts @@ -2,6 +2,12 @@ import { describe, it, expect, vi, beforeEach } from "vitest"; import { Hono } from "hono"; import { authProviderRouter } from "../routes/authProvider.js"; +// ─── Mock auth module ───────────────────────────────────────────────────────── + +vi.mock("../lib/auth.js", () => ({ + reinitAuth: vi.fn().mockResolvedValue(undefined), +})); + // ─── Types ──────────────────────────────────────────────────────────────────── interface MockStaff {