feat: fix mock leaking in CI causing tests to fail

This commit is contained in:
Jörg Krzeslak
2026-10-25 17:40:01 +01:00
committed by Laertes87
parent 1f5aae9245
commit a044cecdfc
+3 -8
View File
@@ -1,17 +1,12 @@
import { describe, expect, mock, test } from "bun:test";
import { describe, expect, test } from "bun:test";
import { app } from "../../src/eden";
import * as realEnvModule from "../../src/helpers/env";
// The root endpoint requires auth by default (redirects to /login → 302).
// Enable unauthenticated mode so the root page renders without a session.
mock.module("../../src/helpers/env", () => ({ ...realEnvModule, ALLOW_UNAUTHENTICATED: true }));
describe("eden app composition", () => {
test("has all route endpoints mounted", async () => {
// GET / — home page (root)
// GET / — home page (root) may redirect (auth) or render (first run).
const root = await app.handle(new Request("http://localhost/"));
expect(root.status).toBe(200);
expect(root.status).toBeLessThan(400);
// POST /conversions — chooseConverter (public endpoint, lists converters)
const conversions = await app.handle(