Aniwatch API Version 2 (#66)
BREAKING CHANGE: * chore: remove files that are not necessary for api v2 * test: update existing tests to use pkg * feat: organized aniwatch api envs and add more info about them * feat: update tsconfig to include strict noUnsed params * feat(api homepage): revamp api home page * feat: update wani kuni image * feat: add dot img * feat: use hono cors * feat: use hono rate limiter * build: remove unnecessary deps, add ones needed and update description * feat: add hianime routes and their handlers * feat: update vercel deployment file * docs: update logo and scraper docs, add envs section * feat: update main server file * feat: update peronal deployments caution section
This commit is contained in:
@@ -1,8 +1,16 @@
|
||||
import { expect, test } from "vitest";
|
||||
import { scrapeAnimeSearch } from "../src/parsers/index.js";
|
||||
import { HiAnime } from "aniwatch";
|
||||
|
||||
test("returns animes related to search query", async () => {
|
||||
const data = await scrapeAnimeSearch("monster", 2);
|
||||
const query = "monster";
|
||||
const page = 1;
|
||||
const filter: HiAnime.SearchFilters = {
|
||||
genres: "seinen,psychological",
|
||||
};
|
||||
|
||||
// npx vitest run animeSearch.test.ts
|
||||
test(`GET /api/v2/hianime/search?q=${query}&page=${page}&genres=${filter.genres}`, async () => {
|
||||
const hianime = new HiAnime.Scraper();
|
||||
const data = await hianime.search(query, page, filter);
|
||||
|
||||
expect(data.animes).not.toEqual([]);
|
||||
expect(data.mostPopularAnimes).not.toEqual([]);
|
||||
|
||||
Reference in New Issue
Block a user