local-date.test.ts 448 B

123456789101112
  1. import { describe, expect, it } from "vitest";
  2. import { formatLocalIsoDate } from "../src/index.js";
  3. describe("local date helpers", () => {
  4. it("formats the local calendar date as YYYY-MM-DD", () => {
  5. expect(formatLocalIsoDate(new Date(2026, 4, 5, 2, 46, 0))).toBe("2026-05-05");
  6. });
  7. it("uses local date fields instead of UTC slicing", () => {
  8. expect(formatLocalIsoDate(new Date(2026, 0, 2, 0, 30, 0))).toBe("2026-01-02");
  9. });
  10. });