Skip to content

Commit

Permalink
test: update hianime scraper unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ghoshRitesh12 committed Oct 4, 2024
1 parent 663073e commit a7aff3a
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion __tests__/hianime/animeAboutInfo.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from "vitest";
import { HiAnime } from "../../src/index.js";

test("returns information about an anime", async () => {
const hianime = new HiAnime();
const hianime = new HiAnime.Scraper();
const data = await hianime.getInfo("steinsgate-3");

expect(data.anime.info.name).not.toEqual(null);
Expand Down
2 changes: 1 addition & 1 deletion __tests__/hianime/animeCategory.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from "vitest";
import { HiAnime } from "../../src/index.js";

test("returns animes belonging to a category", async () => {
const hianime = new HiAnime();
const hianime = new HiAnime.Scraper();
const data = await hianime.getCategoryAnime("subbed-anime");

expect(data.animes).not.toEqual([]);
Expand Down
2 changes: 1 addition & 1 deletion __tests__/hianime/animeEpisodeSrcs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from "vitest";
import { HiAnime } from "../../src/index.js";

test("returns anime episode streaming link(s)", async () => {
const hianime = new HiAnime();
const hianime = new HiAnime.Scraper();
const data = await hianime.getEpisodeSources(
"steinsgate-3?ep=230",
"hd-1",
Expand Down
2 changes: 1 addition & 1 deletion __tests__/hianime/animeEpisodes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from "vitest";
import { HiAnime } from "../../src/index.js";

test("returns episodes info of an anime", async () => {
const hianime = new HiAnime();
const hianime = new HiAnime.Scraper();
const data = await hianime.getEpisodes("steinsgate-3");

expect(data.totalEpisodes).not.toEqual(0);
Expand Down
2 changes: 1 addition & 1 deletion __tests__/hianime/animeGenre.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from "vitest";
import { HiAnime } from "../../src/index.js";

test("returns animes belonging to a genre", async () => {
const hianime = new HiAnime();
const hianime = new HiAnime.Scraper();
const data = await hianime.getGenreAnime("shounen", 2);

expect(data.animes).not.toEqual([]);
Expand Down
2 changes: 1 addition & 1 deletion __tests__/hianime/animeProducer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from "vitest";
import { HiAnime } from "../../src/index.js";

test("returns animes produced by a producer", async () => {
const hianime = new HiAnime();
const hianime = new HiAnime.Scraper();
const data = await hianime.getProducerAnimes("toei-animation", 2);

expect(data.animes).not.toEqual([]);
Expand Down
3 changes: 2 additions & 1 deletion __tests__/hianime/animeSearch.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { expect, test } from "vitest";
import { HiAnime } from "../../src/index.js";

test("returns animes related to search query", async () => {
const hianime = new HiAnime();
const hianime = new HiAnime.Scraper();

const data = await hianime.search("monster", 1, {
genres: "seinen,psychological",
});
Expand Down
2 changes: 1 addition & 1 deletion __tests__/hianime/animeSearchSuggestion.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from "vitest";
import { HiAnime } from "../../src/index.js";

test("returns animes search suggestions related to search query", async () => {
const hianime = new HiAnime();
const hianime = new HiAnime.Scraper();
const data = await hianime.searchSuggestions("one piece");

expect(data.suggestions).not.toEqual([]);
Expand Down
2 changes: 1 addition & 1 deletion __tests__/hianime/episodeServers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from "vitest";
import { HiAnime } from "../../src/index.js";

test("returns episode source servers", async () => {
const hianime = new HiAnime();
const hianime = new HiAnime.Scraper();
const data = await hianime.getEpisodeServers("steinsgate-0-92?ep=2055");

expect(data.episodeId).not.toEqual(null);
Expand Down
2 changes: 1 addition & 1 deletion __tests__/hianime/estimatedSchedule.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function padZero(num: number) {
}

test("returns estimated schedule anime release", async () => {
const hianime = new HiAnime();
const hianime = new HiAnime.Scraper();

const d = new Date();
const data = await hianime.getEstimatedSchedule(
Expand Down
2 changes: 1 addition & 1 deletion __tests__/hianime/homePage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from "vitest";
import { HiAnime } from "../../src/index.js";

test("returns anime information present in homepage", async () => {
const hianime = new HiAnime();
const hianime = new HiAnime.Scraper();
const data = await hianime.getHomePage();

expect(data.spotlightAnimes).not.toEqual([]);
Expand Down

0 comments on commit a7aff3a

Please sign in to comment.