From e86a6975c34fe8f1391160a228928bf52d5b58e0 Mon Sep 17 00:00:00 2001 From: Volta Date: Thu, 29 Oct 2026 10:52:20 +0000 Subject: [PATCH] test(builds): cast the env DB before binding batch Rebased onto main as a single change: #832 squash-merged the behaviour fix, so only the type correction remains. makeEnv() types DB as { prepare }, so env.DB.batch fails TS2339 and the worker build stops at Run checks. Cast through D1Database, following the existing feedback-commit shim in the same file. No behaviour change. tsc clean on those lines; worker suite 1201 passed. --- worker/test/routes.test.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/worker/test/routes.test.ts b/worker/test/routes.test.ts index 954351c8..95ccc8aa 100644 --- a/worker/test/routes.test.ts +++ b/worker/test/routes.test.ts @@ -10398,7 +10398,8 @@ describe("quiver public API v2 — scope resolution", () => { delete: async () => undefined, }; - const realBatch = env.DB.batch.bind(env.DB); + const dbBeforeAdvisory = env.DB as unknown as D1Database; + const realBatch = dbBeforeAdvisory.batch.bind(dbBeforeAdvisory); env.DB = { ...env.DB, async batch(statements: any[]) { @@ -10441,7 +10442,8 @@ describe("quiver public API v2 — scope resolution", () => { }); env.APK_BUCKET = { head: async (key: string) => key === r2Key ? { size: 123 } : null, delete: async () => undefined }; - const realBatch = env.DB.batch.bind(env.DB); + const dbBeforeAdvisory = env.DB as unknown as D1Database; + const realBatch = dbBeforeAdvisory.batch.bind(dbBeforeAdvisory); env.DB = { ...env.DB, async batch(statements: any[]) {