test: using vitest for testing

This commit is contained in:
Ritesh Ghosh
2024-01-07 17:23:46 +05:30
parent 098976ad73
commit 4cf9c57a65
6 changed files with 12 additions and 6 deletions
+2 -1
View File
@@ -1,4 +1,5 @@
import { scrapeAnimeAboutInfo } from "../src/parsers";
import { expect, test } from "vitest";
import { scrapeAnimeAboutInfo } from "../src/parsers/index.js";
test("returns information about an anime", async () => {
const data = await scrapeAnimeAboutInfo("steinsgate-3");
+2 -1
View File
@@ -1,4 +1,5 @@
import { scrapeAnimeCategory } from "../src/parsers";
import { expect, test } from "vitest";
import { scrapeAnimeCategory } from "../src/parsers/index.js";
test("returns animes belonging to a category", async () => {
const data = await scrapeAnimeCategory("subbed-anime");
+2 -1
View File
@@ -1,4 +1,5 @@
import { scrapeGenreAnime } from "../src/parsers";
import { expect, test } from "vitest";
import { scrapeGenreAnime } from "../src/parsers/index.js";
test("returns animes belonging to a genre", async () => {
const data = await scrapeGenreAnime("shounen", 2);
+2 -1
View File
@@ -1,4 +1,5 @@
import { scrapeProducerAnimes } from "../src/parsers";
import { expect, test } from "vitest";
import { scrapeProducerAnimes } from "../src/parsers/index.js";
test("returns animes produced by a producer", async () => {
const data = await scrapeProducerAnimes("toei-animation", 2);
+2 -1
View File
@@ -1,4 +1,5 @@
import { scrapeAnimeSearch } from "../src/parsers";
import { expect, test } from "vitest";
import { scrapeAnimeSearch } from "../src/parsers/index.js";
test("returns animes related to search query", async () => {
const data = await scrapeAnimeSearch("monster", 2);
+2 -1
View File
@@ -1,4 +1,5 @@
import { scrapeHomePage } from "../src/parsers";
import { expect, test } from "vitest";
import { scrapeHomePage } from "../src/parsers/index.js";
test("returns anime information present in homepage", async () => {
const data = await scrapeHomePage();