import { describe, expect, it } from "vitest"; import { isSameIsoDay } from "./dates.ts"; describe("isSameIsoDay", () => { it.each([ ["2026-03-12T09:35:42.138Z", "2026-03-12T00:00:00.000Z", true], ["2026-03-12", "2026-03-12T23:59:59.999Z", true], ["2026-03-12T09:35:42.138Z", "2026-03-13T00:00:00.000Z", false], ["2026-08-09T17:19:26.575Z", "2026-09-12T00:00:00.000Z", false], ])("compares %s and %s as %s", (a, b, expected) => { expect(isSameIsoDay(a, b)).toBe(expected); }); it("is false for a missing value or a value that is not a date", () => { expect(isSameIsoDay(undefined, "2026-03-12")).toBe(false); expect(isSameIsoDay(null, null)).toBe(false); expect(isSameIsoDay("buzz.bookhive.defs#reading", "buzz.bookhive.defs#reading")).toBe(false); }); });