mirror of
https://github.com/C4illin/ConvertX.git
synced 2026-11-07 14:05:44 +01:00
feat: fix mock leaking in CI causing tests to fail
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user