Skip to content

Commit

Permalink
test: update estimated schedule test to use zero padded month in date…
Browse files Browse the repository at this point in the history
… string
  • Loading branch information
ghoshRitesh12 committed Jul 15, 2024
1 parent ce12c5d commit 44ee297
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/estimatedSchedule.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import { expect, test } from "vitest";
import { scrapeEstimatedSchedule } from "../src/parsers/index.js";

function padZero(num: number) {
return num < 10 ? `0${num}` : num.toString();
}

test("returns estimated schedule anime release", async () => {
const d = new Date();
const data = await scrapeEstimatedSchedule(
`${d.getFullYear()}-${d.getMonth() + 1}-${d.getDate()}`
`${d.getFullYear()}-${padZero(d.getMonth() + 1)}-${d.getDate()}`
);

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

0 comments on commit 44ee297

Please sign in to comment.