test: add provider HTTP live coverage

This commit is contained in:
Peter Steinberger
2026-04-24 20:01:43 +01:00
parent 2c516fe516
commit def392ad7d
4 changed files with 81 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
import { describe, expect, it } from "vitest";
import { isLiveTestEnabled } from "../../src/agents/live-test-helpers.js";
import { createKimiWebSearchProvider } from "./src/kimi-web-search-provider.js";
const KIMI_SEARCH_KEY =
process.env.KIMI_API_KEY?.trim() || process.env.MOONSHOT_API_KEY?.trim() || "";
const describeLive = isLiveTestEnabled() && KIMI_SEARCH_KEY.length > 0 ? describe : describe.skip;
describeLive("moonshot plugin live", () => {
it("runs Kimi web search through the provider tool", async () => {
const provider = createKimiWebSearchProvider();
const tool = provider.createTool?.({
config: {},
searchConfig: { kimi: { apiKey: KIMI_SEARCH_KEY }, cacheTtlMinutes: 0 },
} as never);
const result = await tool?.execute({ query: "OpenClaw GitHub", count: 1 });
expect(result?.provider).toBe("kimi");
expect(typeof result?.content).toBe("string");
expect((result?.content as string).length).toBeGreaterThan(20);
expect(Array.isArray(result?.citations)).toBe(true);
}, 120_000);
});