From bee55e1fd4bb39e9a9ba80656ca84bf6ec0cfba1 Mon Sep 17 00:00:00 2001 From: openhands Date: Mon, 3 Aug 2026 17:47:07 +0200 Subject: [PATCH] fix: skip icon-repair integration test when no DB is configured --- src/test-repair-icons.test.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/test-repair-icons.test.ts diff --git a/src/test-repair-icons.test.ts b/src/test-repair-icons.test.ts new file mode 100644 index 00000000..fd312914 --- /dev/null +++ b/src/test-repair-icons.test.ts @@ -0,0 +1,22 @@ +import { describe, it } from "vitest"; + +// Integration test against the live database. Vitest runs without a populated +// .env (SKIP_ENV_VALIDATION=1), so only execute when a DATABASE_URL is provided. +const hasDb = + typeof process.env.DATABASE_URL === "string" && + process.env.DATABASE_URL.length > 0; + +describe.skipIf(!hasDb)("repair icons", () => { + it("runs icon repair", async () => { + const { repairMissingIcons } = await import("@/lib/services/repair-icons"); + + const result = await repairMissingIcons((evt) => { + if (evt.type === "batch_complete") { + console.log("BATCH COMPLETE:", JSON.stringify(evt)); + } else if (evt.type === "error") { + console.log("ERROR:", evt.message); + } + }); + console.log("Result:", JSON.stringify(result)); + }, 600_000); +});