Skip to content

Commit

Permalink
Add env/route.test.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
acouch committed Jan 3, 2025
1 parent a041bf3 commit 43767cb
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions frontend/tests/api/env/route.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* @jest-environment node
*/

import { GET } from "src/app/api/env/route";

jest.mock("src/constants/environments", () => ({
environment: {
AUTH_LOGIN_URL: "testable",
},
}));

describe("/api/env GET handler", () => {
afterEach(() => jest.clearAllMocks());
it("gets correct envars", async () => {
const resp = GET();
const data = (await resp.json()) as { auth_login_url: string };
expect(data.auth_login_url).toBe("testable");
});
});

0 comments on commit 43767cb

Please sign in to comment.