style: prettier format changes
This commit is contained in:
@@ -5,11 +5,11 @@ const animeId = "steinsgate-3";
|
||||
|
||||
// npx vitest run animeAboutInfo.test.ts
|
||||
test(`GET /api/v2/hianime/anime/${animeId}`, async () => {
|
||||
const hianime = new HiAnime.Scraper();
|
||||
const data = await hianime.getInfo(animeId);
|
||||
const hianime = new HiAnime.Scraper();
|
||||
const data = await hianime.getInfo(animeId);
|
||||
|
||||
expect(data.anime.info.name).not.toEqual(null);
|
||||
expect(data.recommendedAnimes).not.toEqual([]);
|
||||
expect(data.mostPopularAnimes).not.toEqual([]);
|
||||
expect(Object.keys(data.anime.moreInfo)).not.toEqual([]);
|
||||
expect(data.anime.info.name).not.toEqual(null);
|
||||
expect(data.recommendedAnimes).not.toEqual([]);
|
||||
expect(data.mostPopularAnimes).not.toEqual([]);
|
||||
expect(Object.keys(data.anime.moreInfo)).not.toEqual([]);
|
||||
});
|
||||
|
||||
@@ -5,12 +5,12 @@ const category = "subbed-anime";
|
||||
|
||||
// npx vitest run animeCategory.test.ts
|
||||
test(`GET /api/v2/hianime/category/${category}`, async () => {
|
||||
const hianime = new HiAnime.Scraper();
|
||||
const data = await hianime.getCategoryAnime(category);
|
||||
const hianime = new HiAnime.Scraper();
|
||||
const data = await hianime.getCategoryAnime(category);
|
||||
|
||||
expect(data.animes).not.toEqual([]);
|
||||
expect(data.genres).not.toEqual([]);
|
||||
expect(data.top10Animes.today).not.toEqual([]);
|
||||
expect(data.top10Animes.week).not.toEqual([]);
|
||||
expect(data.top10Animes.month).not.toEqual([]);
|
||||
expect(data.animes).not.toEqual([]);
|
||||
expect(data.genres).not.toEqual([]);
|
||||
expect(data.top10Animes.today).not.toEqual([]);
|
||||
expect(data.top10Animes.week).not.toEqual([]);
|
||||
expect(data.top10Animes.month).not.toEqual([]);
|
||||
});
|
||||
|
||||
@@ -7,12 +7,12 @@ const category = "sub";
|
||||
|
||||
// npx vitest run animeEpisodeSrcs.test.ts
|
||||
test(`GET /api/v2/hianime/episode/sources?animeEpisodeId=${animeEpisodeId}&server=${server}&category=${category}`, async () => {
|
||||
const hianime = new HiAnime.Scraper();
|
||||
const data = await hianime.getEpisodeSources(
|
||||
animeEpisodeId,
|
||||
server,
|
||||
category
|
||||
);
|
||||
const hianime = new HiAnime.Scraper();
|
||||
const data = await hianime.getEpisodeSources(
|
||||
animeEpisodeId,
|
||||
server,
|
||||
category
|
||||
);
|
||||
|
||||
expect(data.sources).not.toEqual([]);
|
||||
expect(data.sources).not.toEqual([]);
|
||||
});
|
||||
|
||||
@@ -5,9 +5,9 @@ const animeId = "steinsgate-3";
|
||||
|
||||
// npx vitest run animeEpisodes.test.ts
|
||||
test(`GET /api/v2/hianime/anime/${animeId}/episodes`, async () => {
|
||||
const hianime = new HiAnime.Scraper();
|
||||
const data = await hianime.getEpisodes(animeId);
|
||||
const hianime = new HiAnime.Scraper();
|
||||
const data = await hianime.getEpisodes(animeId);
|
||||
|
||||
expect(data.totalEpisodes).not.toEqual(0);
|
||||
expect(data.episodes).not.toEqual([]);
|
||||
expect(data.totalEpisodes).not.toEqual(0);
|
||||
expect(data.episodes).not.toEqual([]);
|
||||
});
|
||||
|
||||
@@ -6,11 +6,11 @@ const page = 2;
|
||||
|
||||
// npx vitest run animeGenre.test.ts
|
||||
test(`GET /api/v2/hianime/genre/${genreName}?page=${page}`, async () => {
|
||||
const hianime = new HiAnime.Scraper();
|
||||
const hianime = new HiAnime.Scraper();
|
||||
|
||||
const data = await hianime.getGenreAnime(genreName, page);
|
||||
const data = await hianime.getGenreAnime(genreName, page);
|
||||
|
||||
expect(data.animes).not.toEqual([]);
|
||||
expect(data.genres).not.toEqual([]);
|
||||
expect(data.topAiringAnimes).not.toEqual([]);
|
||||
expect(data.animes).not.toEqual([]);
|
||||
expect(data.genres).not.toEqual([]);
|
||||
expect(data.topAiringAnimes).not.toEqual([]);
|
||||
});
|
||||
|
||||
@@ -6,12 +6,12 @@ const page = 2;
|
||||
|
||||
// npx vitest run animeProducer.test.ts
|
||||
test(`GET /api/v2/hianime/producer/${producerName}?page=${page}`, async () => {
|
||||
const hianime = new HiAnime.Scraper();
|
||||
const data = await hianime.getProducerAnimes(producerName, page);
|
||||
const hianime = new HiAnime.Scraper();
|
||||
const data = await hianime.getProducerAnimes(producerName, page);
|
||||
|
||||
expect(data.animes).not.toEqual([]);
|
||||
expect(data.topAiringAnimes).not.toEqual([]);
|
||||
expect(data.top10Animes.today).not.toEqual([]);
|
||||
expect(data.top10Animes.week).not.toEqual([]);
|
||||
expect(data.top10Animes.month).not.toEqual([]);
|
||||
expect(data.animes).not.toEqual([]);
|
||||
expect(data.topAiringAnimes).not.toEqual([]);
|
||||
expect(data.top10Animes.today).not.toEqual([]);
|
||||
expect(data.top10Animes.week).not.toEqual([]);
|
||||
expect(data.top10Animes.month).not.toEqual([]);
|
||||
});
|
||||
|
||||
@@ -4,14 +4,14 @@ import { HiAnime } from "aniwatch";
|
||||
const query = "monster";
|
||||
const page = 1;
|
||||
const filter: HiAnime.SearchFilters = {
|
||||
genres: "seinen,psychological",
|
||||
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);
|
||||
const hianime = new HiAnime.Scraper();
|
||||
const data = await hianime.search(query, page, filter);
|
||||
|
||||
expect(data.animes).not.toEqual([]);
|
||||
expect(data.mostPopularAnimes).not.toEqual([]);
|
||||
expect(data.animes).not.toEqual([]);
|
||||
expect(data.mostPopularAnimes).not.toEqual([]);
|
||||
});
|
||||
|
||||
@@ -5,8 +5,8 @@ const query = "one piece";
|
||||
|
||||
// npx vitest run animeSearchSuggestion.test.ts
|
||||
test(`GET /api/v2/hianime/search/suggestion?q=${query}`, async () => {
|
||||
const hianime = new HiAnime.Scraper();
|
||||
const data = await hianime.searchSuggestions(query);
|
||||
const hianime = new HiAnime.Scraper();
|
||||
const data = await hianime.searchSuggestions(query);
|
||||
|
||||
expect(data.suggestions).not.toEqual([]);
|
||||
expect(data.suggestions).not.toEqual([]);
|
||||
});
|
||||
|
||||
@@ -5,11 +5,11 @@ const animeEpisodeId = "steinsgate-0-92?ep=2055";
|
||||
|
||||
// npx vitest run episodeServers.test.ts
|
||||
test(`GET /api/v2/hianime/episode/servers?animeEpisodeId=${animeEpisodeId}`, async () => {
|
||||
const hianime = new HiAnime.Scraper();
|
||||
const data = await hianime.getEpisodeServers(animeEpisodeId);
|
||||
const hianime = new HiAnime.Scraper();
|
||||
const data = await hianime.getEpisodeServers(animeEpisodeId);
|
||||
|
||||
expect(data.episodeId).not.toEqual(null);
|
||||
expect(data.episodeNo).not.toEqual(0);
|
||||
expect(data.sub).not.toEqual([]);
|
||||
expect(data.dub).not.toEqual([]);
|
||||
expect(data.episodeId).not.toEqual(null);
|
||||
expect(data.episodeNo).not.toEqual(0);
|
||||
expect(data.sub).not.toEqual([]);
|
||||
expect(data.dub).not.toEqual([]);
|
||||
});
|
||||
|
||||
@@ -5,13 +5,13 @@ const padZero = (num: number) => (num < 10 ? `0${num}` : num.toString());
|
||||
|
||||
const d = new Date();
|
||||
const date = `${d.getFullYear()}-${padZero(d.getMonth() + 1)}-${padZero(
|
||||
d.getDate()
|
||||
d.getDate()
|
||||
)}`;
|
||||
|
||||
// npx vitest run estimatedSchedule.test.ts
|
||||
test(`GET /api/v2/hianime/schedule?date=${date}`, async () => {
|
||||
const hianime = new HiAnime.Scraper();
|
||||
const data = await hianime.getEstimatedSchedule(date);
|
||||
const hianime = new HiAnime.Scraper();
|
||||
const data = await hianime.getEstimatedSchedule(date);
|
||||
|
||||
expect(data.scheduledAnimes).not.toEqual([]);
|
||||
expect(data.scheduledAnimes).not.toEqual([]);
|
||||
});
|
||||
|
||||
+14
-14
@@ -2,20 +2,20 @@ import { expect, test } from "vitest";
|
||||
import { HiAnime } from "aniwatch";
|
||||
|
||||
test("GET /api/v2/hianime/home", async () => {
|
||||
const hianime = new HiAnime.Scraper();
|
||||
const data = await hianime.getHomePage();
|
||||
const hianime = new HiAnime.Scraper();
|
||||
const data = await hianime.getHomePage();
|
||||
|
||||
expect(data.spotlightAnimes).not.toEqual([]);
|
||||
expect(data.trendingAnimes).not.toEqual([]);
|
||||
expect(data.latestEpisodeAnimes).not.toEqual([]);
|
||||
expect(data.topUpcomingAnimes).not.toEqual([]);
|
||||
expect(data.topAiringAnimes).not.toEqual([]);
|
||||
expect(data.mostPopularAnimes).not.toEqual([]);
|
||||
expect(data.mostFavoriteAnimes).not.toEqual([]);
|
||||
expect(data.latestCompletedAnimes).not.toEqual([]);
|
||||
expect(data.genres).not.toEqual([]);
|
||||
expect(data.spotlightAnimes).not.toEqual([]);
|
||||
expect(data.trendingAnimes).not.toEqual([]);
|
||||
expect(data.latestEpisodeAnimes).not.toEqual([]);
|
||||
expect(data.topUpcomingAnimes).not.toEqual([]);
|
||||
expect(data.topAiringAnimes).not.toEqual([]);
|
||||
expect(data.mostPopularAnimes).not.toEqual([]);
|
||||
expect(data.mostFavoriteAnimes).not.toEqual([]);
|
||||
expect(data.latestCompletedAnimes).not.toEqual([]);
|
||||
expect(data.genres).not.toEqual([]);
|
||||
|
||||
expect(data.top10Animes.today).not.toEqual([]);
|
||||
expect(data.top10Animes.week).not.toEqual([]);
|
||||
expect(data.top10Animes.month).not.toEqual([]);
|
||||
expect(data.top10Animes.today).not.toEqual([]);
|
||||
expect(data.top10Animes.week).not.toEqual([]);
|
||||
expect(data.top10Animes.month).not.toEqual([]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user