UNPKG

422 BPlain TextView Raw
1import { es } from "date-fns/locale/es";
2
3import { formatWeekdayName } from "./formatWeekdayName";
4
5const date = new Date(2022, 10, 21);
6
7test("should return the formatted weekday name", () => {
8 expect(formatWeekdayName(date)).toEqual("Mo");
9});
10
11describe("when a locale is passed in", () => {
12 test("should format using the locale", () => {
13 expect(formatWeekdayName(date, { locale: es })).toEqual("lu");
14 });
15});