
























@@ -28,6 +28,16 @@ describe("Ollama provider", () => {
2828const countFetchCallUrls = (fetchMock: ReturnType<typeof vi.fn>, suffix: string): number =>
2929fetchCallUrls(fetchMock).reduce((count, url) => count + (url.endsWith(suffix) ? 1 : 0), 0);
303031+const countWarnCallsIncluding = (warnSpy: ReturnType<typeof vi.spyOn>, text: string): number => {
32+let count = 0;
33+for (const [message] of warnSpy.mock.calls) {
34+if (String(message).includes(text)) {
35+count++;
36+}
37+}
38+return count;
39+};
40+3141const expectDiscoveryCallCounts = (
3242fetchMock: ReturnType<typeof vi.fn>,
3343params: { tags: number; show: number },
@@ -274,9 +284,7 @@ describe("Ollama provider", () => {
274284env: { VITEST: "", NODE_ENV: "development" },
275285});
276286277-expect(
278-warnSpy.mock.calls.filter(([message]) => String(message).includes("Ollama")).length,
279-).toBeGreaterThan(0);
287+expect(countWarnCallsIncluding(warnSpy, "Ollama")).toBeGreaterThan(0);
280288warnSpy.mockRestore();
281289});
282290});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。