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