From a7b66d5a815e1dbe63a297b7fa93231af34c7f13 Mon Sep 17 00:00:00 2001 From: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> Date: Thu, 10 Sep 2026 11:49:52 -0300 Subject: [PATCH] fix(tests): drop three needless `as any` casts on the volcengine testing surface (base-red #12732) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `release/v3.8.51` is red on `ESLint errors: 3 error(s)`: tests/unit/volcengine-plan-binding-upsert.test.ts:70,96,120 error @typescript-eslint/no-explicit-any — Unexpected any. The violations are not new. #12795 regenerated `config/quality/eslint-suppressions.json` and pruned the entry that had these three frozen (0 additions, 5 deletions on that file), so a rule that is `error` in `tests/` since #6218 started failing the whole-repo lint on code the PR never touched. The casts were unnecessary to begin with: `__testing` exports `upsertConnection` directly (`src/lib/providers/volcenginePlanBinding.ts:380-383`) and it is a normally typed exported function, so `bindingTesting.upsertConnection(...)` resolves without help. Removing `as any` both clears the errors and puts the three call sites under type checking instead of opting them out — strictly better than restoring the suppression. Validated: eslint on the file exits 1 with all three errors before and 0 after; `typecheck:core` 0 errors; the file's own suite passes 3/3. --- tests/unit/volcengine-plan-binding-upsert.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/unit/volcengine-plan-binding-upsert.test.ts b/tests/unit/volcengine-plan-binding-upsert.test.ts index 51a3ca840e..44d7e6b4ee 100644 --- a/tests/unit/volcengine-plan-binding-upsert.test.ts +++ b/tests/unit/volcengine-plan-binding-upsert.test.ts @@ -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", @@ -93,7 +93,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 +117,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",