mirror of
https://github.com/zoriya/Kyoo.git
synced 2026-05-29 09:33:29 +00:00
Fix tests & misc errors
This commit is contained in:
+18
-13
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user