test: cover base_url fallback and cross-field ollama exclusion

This commit is contained in:
Troed Sångberg
2026-08-21 12:30:23 +02:00
parent f49caf05cd
commit 56366982e2
+10
View File
@@ -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"])
})