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