refactor: rename drop functions for clarity and update tests

This commit is contained in:
fzzinchemical
2025-03-28 07:49:42 +01:00
parent 442dd6f4c6
commit d8be2c92f0
5 changed files with 146 additions and 98 deletions

View File

@@ -0,0 +1,32 @@
import { assert } from "@std/assert/assert";
import {
dropYandere,
getPage,
refresh,
setPage,
} from "@root/plugins/yandere/api.ts";
import { assertEquals } from "@std/assert/equals";
//tests
/*
get page,
switch page,
drop,
*/
Deno.test("Get default Page", async () => {
assertEquals(getPage(), 1);
});
Deno.test("Switching page", async () => {
assertEquals(getPage(), 1);
await setPage(2);
assertEquals(getPage(), 2);
await setPage(100);
assertEquals(getPage(), 100);
});
Deno.test("Test Drop", async () => {
await refresh();
const link = await dropYandere();
assert(link !== "", "Empty String was dropped!");
});