Skip to content

Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors

test: fix TypeScript configuration errors in plan3-p0.test.ts

diegosouzapw26edd01ca34a
diff --git a/tests/unit/plan3-p0.test.ts b/tests/unit/plan3-p0.test.ts
index 6478c711f0..f604f40a3b 100644
--- a/tests/unit/plan3-p0.test.ts
+++ b/tests/unit/plan3-p0.test.ts
@@ -73,10 +73,10 @@ test("getModelInfoCore resolves explicit gpt-5.5 Codex model", async () => {
test("getModelInfoCore returns explicit ambiguity metadata for ambiguous unprefixed model", async () => {
const info = await getModelInfoCore("claude-haiku-4.5", {});
assert.equal(info.provider, null);
- assert.equal(info.errorType, "ambiguous_model");
- assert.match(info.errorMessage, /Ambiguous model/i);
- assert.ok(Array.isArray(info.candidateProviders));
- assert.ok(info.candidateProviders.length >= 2);
+ assert.equal((info as any).errorType, "ambiguous_model");
+ assert.match((info as any).errorMessage, /Ambiguous model/i);
+ assert.ok(Array.isArray((info as any).candidateProviders));
+ assert.ok((info as any).candidateProviders.length >= 2);
});
test("getModelInfoCore canonicalizes github legacy alias with explicit provider prefix", async () => {
@@ -101,8 +101,8 @@ test("DefaultExecutor uses x-api-key for kimi-coding-apikey", () => {
const executor = new DefaultExecutor("kimi-coding-apikey");
const headers = executor.buildHeaders({ apiKey: "sk-kimi-test" }, true);
- assert.equal(headers["x-api-key"], "sk-kimi-test");
- assert.equal(headers.Authorization, undefined);
+ assert.equal((headers as any)["x-api-key"], "sk-kimi-test");
+ assert.equal((headers as any).Authorization, undefined);
});
test("DefaultExecutor execute honors connection-level custom User-Agent", async () => {
@@ -111,7 +111,7 @@ test("DefaultExecutor execute honors connection-level custom User-Agent", async
let capturedHeaders = null;
globalThis.fetch = async (_url, init = {}) => {
- capturedHeaders = init.headers || null;
+ capturedHeaders = (init as any).headers || null;
return new Response(JSON.stringify({ id: "chatcmpl-test" }), { status: 200 });
};
@@ -144,7 +144,8 @@ test("CodexExecutor forces stream=true for upstream compatibility", () => {
const transformed = executor.transformRequest(
"gpt-5.1-codex",
{ model: "gpt-5.1-codex", input: [], stream: false },
- false
+ false,
+ {}
);
assert.equal(transformed.stream, true);
});
@@ -193,7 +194,8 @@ test("CodexExecutor maps fast service tier to priority", () => {
const transformed = executor.transformRequest(
"gpt-5.1-codex",
{ model: "gpt-5.1-codex", input: [], service_tier: "fast" },
- true
+ true,
+ {}
);
assert.equal(transformed.service_tier, "priority");
});
@@ -302,7 +304,8 @@ test("CodexExecutor preserves native responses payloads for Codex passthrough",
_nativeCodexPassthrough: true,
stream: false,
},
- false
+ false,
+ {}
);
assert.equal(transformed.stream, true);