diff --git a/changelog.d/maintenance/0000-basered-eslint-volcengine-any.md b/changelog.d/maintenance/0000-basered-eslint-volcengine-any.md new file mode 100644 index 0000000000..89bdf44e27 --- /dev/null +++ b/changelog.d/maintenance/0000-basered-eslint-volcengine-any.md @@ -0,0 +1 @@ +- Clear the `release/v3.8.51` base-red reported by #12732: drop the three `as any` casts in `tests/unit/volcengine-plan-binding-upsert.test.ts` (`__testing` already exports a typed `upsertConnection`), which tripped `no-explicit-any` (an error in `tests/`) on the tip. diff --git a/tests/unit/volcengine-plan-binding-upsert.test.ts b/tests/unit/volcengine-plan-binding-upsert.test.ts index 51a3ca840e..931566fd89 100644 --- a/tests/unit/volcengine-plan-binding-upsert.test.ts +++ b/tests/unit/volcengine-plan-binding-upsert.test.ts @@ -4,11 +4,11 @@ import fs from "node:fs"; import path from "node:path"; import os from "node:os"; import { resetDbInstance } from "../../src/lib/db/core.ts"; +import { createProviderConnection, getProviderConnectionById } from "../../src/models/index.ts"; import { - createProviderConnection, - getProviderConnectionById, -} from "../../src/models/index.ts"; -import { detectPlan, __testing as bindingTesting } from "../../src/lib/providers/volcenginePlanBinding.ts"; + detectPlan, + __testing as bindingTesting, +} from "../../src/lib/providers/volcenginePlanBinding.ts"; test("detectPlan returns available: false when account has no active quota windows (unsubscribed)", async (t) => { const originalFetch = globalThis.fetch; @@ -67,7 +67,7 @@ test("volcenginePlanBinding upsert rules with SQLite temp isolation", async (t) providerSpecificData: { autoFetchModels: true, customTag: "keep-me" }, }); - const updated1 = await (bindingTesting as any).upsertConnection( + const updated1 = await bindingTesting.upsertConnection( "coding", "ark-new-key-1", "new-cookie-1", @@ -80,8 +80,16 @@ test("volcenginePlanBinding upsert rules with SQLite temp isolation", async (t) assert.equal(updated1.id, conn1.id); assert.equal(updated1.name, "main", "Preserves original custom name 'main'"); assert.equal(updated1.apiKey, "ark-new-key-1"); - assert.equal(updated1.providerSpecificData.autoFetchModels, true, "Preserves existing PSD autoFetchModels"); - assert.equal(updated1.providerSpecificData.customTag, "keep-me", "Preserves existing PSD customTag"); + assert.equal( + updated1.providerSpecificData.autoFetchModels, + true, + "Preserves existing PSD autoFetchModels" + ); + assert.equal( + updated1.providerSpecificData.customTag, + "keep-me", + "Preserves existing PSD customTag" + ); assert.equal(updated1.providerSpecificData.volcConsoleCookie, "new-cookie-1"); assert.equal(updated1.providerSpecificData.volcApiKeyId, 123); @@ -93,7 +101,7 @@ test("volcenginePlanBinding upsert rules with SQLite temp isolation", async (t) providerSpecificData: {}, }); - const createdNew = await (bindingTesting as any).upsertConnection( + const createdNew = await bindingTesting.upsertConnection( "coding", "ark-brand-new-key-3", "new-cookie-3", @@ -117,7 +125,7 @@ test("volcenginePlanBinding upsert rules with SQLite temp isolation", async (t) }); // Passing conn1.id (which is coding-plan) into agent upsert must NOT match conn1 - const agentUpsertResult = await (bindingTesting as any).upsertConnection( + const agentUpsertResult = await bindingTesting.upsertConnection( "agent", "ark-agent-new-key", "agent-cookie", @@ -168,7 +176,8 @@ test("findTargetConnection pure matching logic and single-connection adoption in { id: "c2", provider: "volcengine-coding-plan", providerSpecificData: { volcApiKeyId: 888 } }, ]; assert.equal( - bindingTesting.findTargetConnection(list3, { ...criteria, apiKey: undefined, apiKeyId: 888 })?.id, + bindingTesting.findTargetConnection(list3, { ...criteria, apiKey: undefined, apiKeyId: 888 }) + ?.id, "c2" );