From 56366982e222cc27ede85a3ec55ede35f7c1795a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Troed=20S=C3=A5ngberg?= Date: Fri, 21 Aug 2026 12:30:23 +0200 Subject: [PATCH] test: cover base_url fallback and cross-field ollama exclusion --- test-backoff.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test-backoff.ts b/test-backoff.ts index 887a812..ea26da1 100644 --- a/test-backoff.ts +++ b/test-backoff.ts @@ -141,3 +141,13 @@ test("nothing anywhere falls back to localhost", () => { "http://localhost:8080", ]) }) + +test("provider base_url fallback is detected", () => { + const snake = [{ id: "llamacpp", name: "llama.cpp", options: { base_url: "http://localhost:9090/v1" } }] + assert.deepEqual(resolveServerUrls(undefined, snake, {}), ["http://localhost:9090"]) +}) + +test("ollama in id excludes even when name mentions llama", () => { + const mixed = [{ id: "ollama-bridge", name: "My llama server", options: { baseURL: "http://localhost:11434" } }] + assert.deepEqual(resolveServerUrls(undefined, mixed, {}), ["http://localhost:8080"]) +})