Files
EpicNext-Cms/src/test-repair-icons.test.ts
T
openhands bee55e1fd4
CI / check (push) Successful in 24s
CI / release (push) Skipped
CI / deploy (push) Successful in 1m2s
fix: skip icon-repair integration test when no DB is configured
2026-08-03 17:47:07 +02:00

23 lines
775 B
TypeScript

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);
});