move api tests to different location
This commit is contained in:
@@ -54,19 +54,3 @@ export function getPosts(search? : string){
|
|||||||
const url = prepareURLObjectForRequest("post")
|
const url = prepareURLObjectForRequest("post")
|
||||||
return handlePostRequest(url, search)
|
return handlePostRequest(url, search)
|
||||||
}
|
}
|
||||||
|
|
||||||
Deno.test("Empty Post Request", async() => {
|
|
||||||
console.debug(await getPosts())
|
|
||||||
})
|
|
||||||
|
|
||||||
Deno.test("Post Request with tag", async() => {
|
|
||||||
console.debug(await getPosts("[tags:love_live!_(series)]"))
|
|
||||||
})
|
|
||||||
|
|
||||||
Deno.test("Post Request with limit", async() => {
|
|
||||||
console.debug(await getPosts("[limit: 1)]"))
|
|
||||||
})
|
|
||||||
|
|
||||||
Deno.test("Post Request with page", async() => {
|
|
||||||
console.debug(await getPosts("[page: 30)]"))
|
|
||||||
})
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
import { assert } from "@std/assert/assert";
|
|
||||||
import {
|
|
||||||
dropYandere,
|
|
||||||
getPage,
|
|
||||||
refresh,
|
|
||||||
setPage,
|
|
||||||
} from "./api/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!");
|
|
||||||
});
|
|
||||||
|
|||||||
17
src/plugins/yandere/tests/api.ts
Normal file
17
src/plugins/yandere/tests/api.ts
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
import { getPosts } from "@root/plugins/yandere/api/api.ts"
|
||||||
|
|
||||||
|
Deno.test("Empty Post Request", async() => {
|
||||||
|
console.debug(await getPosts())
|
||||||
|
})
|
||||||
|
|
||||||
|
Deno.test("Post Request with tag", async() => {
|
||||||
|
console.debug(await getPosts("[tags:love_live!_(series)]"))
|
||||||
|
})
|
||||||
|
|
||||||
|
Deno.test("Post Request with limit", async() => {
|
||||||
|
console.debug(await getPosts("[limit: 1)]"))
|
||||||
|
})
|
||||||
|
|
||||||
|
Deno.test("Post Request with page", async() => {
|
||||||
|
console.debug(await getPosts("[page: 30)]"))
|
||||||
|
})
|
||||||
Reference in New Issue
Block a user