Fix tests & misc errors

This commit is contained in:
Zoe Roux
2025-04-07 15:38:08 +02:00
parent db0b244286
commit 080da9bc27
11 changed files with 136 additions and 53 deletions
+12 -14
View File
@@ -1,4 +1,4 @@
import { beforeAll, describe, expect, it } from "bun:test";
import { describe, expect, it } from "bun:test";
import { eq } from "drizzle-orm";
import { defaultBlurhash, processImages } from "~/controllers/seed/images";
import { db } from "~/db";
@@ -6,21 +6,19 @@ import { mqueue, shows, staff, studios, videos } from "~/db/schema";
import { madeInAbyss } from "~/models/examples";
import { createSerie } from "../helpers";
beforeAll(async () => {
await db.delete(shows);
await db.delete(studios);
await db.delete(staff);
await db.delete(videos);
await db.delete(mqueue);
await createSerie(madeInAbyss);
const release = await processImages();
// remove notifications to prevent other images to be downloaded (do not curl 20000 images for nothing)
release();
});
describe("images", () => {
it("Create a serie download images", async () => {
await db.delete(shows);
await db.delete(studios);
await db.delete(staff);
await db.delete(videos);
await db.delete(mqueue);
await createSerie(madeInAbyss);
const release = await processImages();
// remove notifications to prevent other images to be downloaded (do not curl 20000 images for nothing)
release();
const ret = await db.query.shows.findFirst({
where: eq(shows.slug, madeInAbyss.slug),
});