Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions test/server.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,18 @@ test("retries transient fetch failures before succeeding", async () => {
assert.equal(result.status, 200);
assert.equal(attempts, 3);
});

test("returns 400 for missing URL", async () => {
const app = createApp({
apiKey: "test-key",
allowedOrigins: ["http://localhost:3000"],
fetchImpl: async () => ({
ok: true,
json: async () => ({})
})
});

const result = await runRequest(app, {}, "http://localhost:3000");
assert.equal(result.status, 400);
assert.equal(result.body.error, "No URL provided");
});