test: tighten kimi coding provider assertions

This commit is contained in:
Shakker
2026-05-11 07:35:37 +01:00
parent 8847d390bc
commit 6378068d25
3 changed files with 52 additions and 4 deletions

View File

@@ -47,10 +47,42 @@ describe("Kimi implicit provider (#22409)", () => {
it("publishes the Kimi provider when an API key is resolved", async () => {
const provider = await runKimiCatalogProvider({ apiKey: "test-key" });
expect(provider).toMatchObject({
apiKey: "test-key",
expect(provider).toEqual({
baseUrl: "https://api.kimi.com/coding/",
api: "anthropic-messages",
headers: {
"User-Agent": "claude-code/0.1.0",
},
models: [
{
id: "kimi-for-coding",
name: "Kimi Code",
reasoning: true,
input: ["text", "image"],
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
contextWindow: 262144,
maxTokens: 32768,
},
{
id: "kimi-code",
name: "Kimi Code (legacy kimi-code)",
reasoning: true,
input: ["text", "image"],
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
contextWindow: 262144,
maxTokens: 32768,
},
{
id: "k2p5",
name: "Kimi Code (legacy k2p5)",
reasoning: true,
input: ["text", "image"],
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
contextWindow: 262144,
maxTokens: 32768,
},
],
apiKey: "test-key",
});
});

View File

@@ -17,7 +17,12 @@ describe("kimi provider plugin", () => {
api: "anthropic-messages",
},
} as never),
).toMatchObject({ id: "kimi-for-coding" });
).toEqual({
id: "kimi-for-coding",
name: "Kimi Code",
provider: "kimi",
api: "anthropic-messages",
});
});
it("uses binary thinking with thinking off by default", async () => {

View File

@@ -17,9 +17,20 @@ describe("kimi coding onboard", () => {
const cfg = applyKimiCodeProviderConfig({});
const provider = cfg.models?.providers?.kimi;
expect(provider).toMatchObject({
expect(provider).toEqual({
api: "anthropic-messages",
baseUrl: "https://api.kimi.com/coding/",
models: [
{
id: "kimi-for-coding",
name: "Kimi Code",
reasoning: true,
input: ["text", "image"],
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
contextWindow: 262144,
maxTokens: 32768,
},
],
});
expect(provider?.models?.map((model) => model.id)).toEqual(["kimi-for-coding"]);
expect(cfg.agents?.defaults?.models?.[KIMI_MODEL_REF]?.alias).toBe("Kimi");