fix: mock authentication logic in server test to ensure tests for protected routes pass.
Some checks failed
Deploy to Production / test (push) Failing after 29s
Some checks failed
Deploy to Production / test (push) Failing after 29s
This commit is contained in:
@@ -66,7 +66,14 @@ mock.module("@shared/lib/config", () => ({
|
|||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// 4. Mock BotClient (used by stats helper for maintenanceMode)
|
// 4. Mock auth (bypass authentication for testing)
|
||||||
|
mock.module("./routes/auth.routes", () => ({
|
||||||
|
authRoutes: { name: "auth", handler: () => null },
|
||||||
|
isAuthenticated: () => true,
|
||||||
|
getSession: () => ({ discordId: "123", username: "testuser", expiresAt: Date.now() + 3600000 }),
|
||||||
|
}));
|
||||||
|
|
||||||
|
// 5. Mock BotClient (used by stats helper for maintenanceMode)
|
||||||
mock.module("../../bot/lib/BotClient", () => ({
|
mock.module("../../bot/lib/BotClient", () => ({
|
||||||
AuroraClient: {
|
AuroraClient: {
|
||||||
maintenanceMode: false,
|
maintenanceMode: false,
|
||||||
|
|||||||
Reference in New Issue
Block a user