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 <noreply@paperclip.ing>
This commit is contained in:
@@ -2,6 +2,12 @@ import { describe, it, expect, vi, beforeEach } from "vitest";
|
|||||||
import { Hono } from "hono";
|
import { Hono } from "hono";
|
||||||
import { authProviderRouter } from "../routes/authProvider.js";
|
import { authProviderRouter } from "../routes/authProvider.js";
|
||||||
|
|
||||||
|
// ─── Mock auth module ─────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
vi.mock("../lib/auth.js", () => ({
|
||||||
|
reinitAuth: vi.fn().mockResolvedValue(undefined),
|
||||||
|
}));
|
||||||
|
|
||||||
// ─── Types ────────────────────────────────────────────────────────────────────
|
// ─── Types ────────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
interface MockStaff {
|
interface MockStaff {
|
||||||
|
|||||||
Reference in New Issue
Block a user