fix: skip icon-repair integration test when no DB is configured
This commit is contained in:
1 parent
613b7502e1
commit
bee55e1fd4
1 file changed
+22
@@ -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);
|
||||
});
|
||||
Reference in new issue
Block a user