Skip to content

Commit 93ba924

Browse files
committed
test: tighten ollama stream timeout assertion
1 parent 8694a6a commit 93ba924

1 file changed

Lines changed: 19 additions & 5 deletions

File tree

extensions/ollama/src/stream.test.ts

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,24 @@ describe("createOllamaStreamFn thinking events", () => {
229229
it("uses generic stream timeout for Ollama request timeout", async () => {
230230
await streamOllamaEvents([makeOllamaResponse({ content: "ok" })], { timeoutMs: 2500 });
231231

232-
expect(fetchWithSsrFGuardMock).toHaveBeenCalledWith(
233-
expect.objectContaining({
234-
timeoutMs: 2500,
235-
}),
236-
);
232+
expect(fetchWithSsrFGuardMock).toHaveBeenCalledWith({
233+
url: "http://localhost:11434/api/chat",
234+
init: {
235+
method: "POST",
236+
headers: { "Content-Type": "application/json" },
237+
body: JSON.stringify({
238+
model: "qwen3.5",
239+
messages: [{ role: "user", content: "test" }],
240+
stream: true,
241+
options: {},
242+
}),
243+
},
244+
policy: {
245+
allowPrivateNetwork: true,
246+
hostnameAllowlist: ["localhost"],
247+
},
248+
timeoutMs: 2500,
249+
auditContext: "ollama-stream.chat",
250+
});
237251
});
238252
});

0 commit comments

Comments
 (0)