sendou.ink/app/features/mmr/core/Seasons.test.ts
Kalle 6a3ec6a654
Some checks are pending
E2E Tests / e2e (push) Waiting to run
Tests and checks on push / run-checks-and-tests (push) Waiting to run
Updates translation progress / update-translation-progress-issue (push) Waiting to run
Various small bug fixes
2026-06-08 22:04:43 +03:00

19 lines
562 B
TypeScript

import { describe, expect, it } from "vitest";
import { list, nthToDateRange } from "./Seasons";
describe("nthToDateRange()", () => {
it("returns the date range for an existing season", () => {
const { starts, ends } = nthToDateRange(0);
expect(starts).toEqual(list[0].starts);
expect(ends).toEqual(list[0].ends);
});
it("throws for a season number past the end of the list", () => {
expect(() => nthToDateRange(list.length)).toThrow();
});
it("throws for a negative season number", () => {
expect(() => nthToDateRange(-1)).toThrow();
});
});