UNPKG

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