Fix tests & misc errors

This commit is contained in:
2025-04-07 15:38:08 +02:00
parent db0b244286
commit 080da9bc27
11 changed files with 136 additions and 53 deletions
+18 -13
View File
@@ -1,24 +1,29 @@
import { processImages } from "~/controllers/seed/images";
import { db, migrate } from "~/db";
import { mqueue, shows, videos } from "~/db/schema";
import { madeInAbyss, madeInAbyssVideo } from "~/models/examples";
import { createSerie, createVideo, getSerie } from "./helpers";
import { profiles, shows } from "~/db/schema";
import { madeInAbyss } from "~/models/examples";
import { createSerie, getSerie, setSerieStatus } from "./helpers";
import { getJwtHeaders } from "./helpers/jwt";
// test file used to run manually using `bun tests/manual.ts`
await migrate();
await db.delete(shows);
await db.delete(videos);
await db.delete(mqueue);
await db.delete(profiles);
const [_, vid] = await createVideo(madeInAbyssVideo);
console.log(vid);
const [__, ser] = await createSerie(madeInAbyss);
console.log(await getJwtHeaders());
const [_, ser] = await createSerie(madeInAbyss);
console.log(ser);
const [__, ret] = await setSerieStatus(madeInAbyss.slug, {
status: "watching",
startedAt: "2024-12-21",
completedAt: "2024-12-21",
seenCount: 2,
score: 85,
});
console.log(ret);
await processImages();
const [___, got] = await getSerie(madeInAbyss.slug, { with: ["translations"] });
console.log(got);
const [___, got] = await getSerie(madeInAbyss.slug, {});
console.log(JSON.stringify(got, undefined, 4));
process.exit(0);