CodeIssuesDiscussionsWikiPull RequestsProjectsCommitsActionsReleasesContributorsPulse● GatesSecuritySettingsDeploymentsPipelineInsightsAgents✨ Explain✨ Ask AI✨ Workspace✨ Spec✨ Tests▓ Debt Map✨ NL Search🏛 Archaeology
Blame · Line-by-line history
code-scanning.test.ts
Each line is annotated with the commit that last touched it. Click any SHA to jump to that commit and see the surrounding change.
| 08420cd | 1 | /** |
| 2 | * Block I5 — Code scanning UI tests. | |
| 3 | * | |
| 4 | * The route uses softAuth + hits the DB on every request, so without a live | |
| 5 | * DATABASE_URL we can't exercise the 404 path in unit tests. We verify the | |
| 6 | * route is mounted by asserting that `/:owner/:repo/security` produces a | |
| 7 | * response (any status) rather than being swallowed by an unrelated handler. | |
| 8 | */ | |
| 9 | ||
| 10 | import { describe, it, expect } from "bun:test"; | |
| 11 | import app from "../app"; | |
| 12 | ||
| 13 | describe("code-scanning — route mount", () => { | |
| 14 | it("GET /:owner/:repo/security is handled (not swallowed)", async () => { | |
| 15 | const res = await app.request( | |
| 16 | "/__does_not_exist_user__/__nope__/security" | |
| 17 | ); | |
| 18 | // Without a DB connection the handler 500s. With a DB it returns 404. | |
| 19 | // Either proves the route was reached. | |
| 20 | expect([404, 500]).toContain(res.status); | |
| 21 | }); | |
| 22 | }); |