test: update estimated schedule test to use zero padded month in date string
This commit is contained in:
@@ -1,10 +1,14 @@
|
|||||||
import { expect, test } from "vitest";
|
import { expect, test } from "vitest";
|
||||||
import { scrapeEstimatedSchedule } from "../src/parsers/index.js";
|
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 () => {
|
test("returns estimated schedule anime release", async () => {
|
||||||
const d = new Date();
|
const d = new Date();
|
||||||
const data = await scrapeEstimatedSchedule(
|
const data = await scrapeEstimatedSchedule(
|
||||||
`${d.getFullYear()}-${d.getMonth() + 1}-${d.getDate()}`
|
`${d.getFullYear()}-${padZero(d.getMonth() + 1)}-${d.getDate()}`
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(data.scheduledAnimes).not.toEqual([]);
|
expect(data.scheduledAnimes).not.toEqual([]);
|
||||||
|
|||||||
Reference in New Issue
Block a user