Skip to content

Commit

Permalink
[External] Increase test coverage for dateUtil module in frontend. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
yebra06 authored Jan 7, 2025
1 parent d06b565 commit fb99846
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions frontend/tests/utils/dateUtil.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,12 @@ describe("formatDate", () => {
it("returns a human readable string for properly formatted dates", () => {
expect(formatDate("2024-10-10")).toBe("October 10, 2024");
});

it("invokes console warn when date string does not contain 3 parts", () => {
const logSpy = jest.spyOn(global.console, "warn");
formatDate("10-1019999");
expect(logSpy).toHaveBeenCalledWith(
"invalid date string provided for parse",
);
});
});

0 comments on commit fb99846

Please sign in to comment.