Skip to content

Commit

Permalink
Refactor newsLib.getSortedPostsData to include post excerpts
Browse files Browse the repository at this point in the history
  • Loading branch information
FoggyMtnDrifter committed Feb 18, 2024
1 parent 9a5d899 commit e9a31f3
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions lib/__tests__/news.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,18 @@ describe("News Library", () => {
it("should return an array of sorted post data", async () => {
const sortedPosts = await newsLib.getSortedPostsData();
expect(sortedPosts).toStrictEqual([
{ slug: "post2", date: "2022-01-02", title: "Post 2" },
{ slug: "post1", date: "2022-01-01", title: "Post 1" },
{
slug: "post2",
excerpt: "Mocked HTML content...",
date: "2022-01-02",
title: "Post 2",
},
{
slug: "post1",
excerpt: "Mocked HTML content...",
date: "2022-01-01",
title: "Post 1",
},
]);
});
});
Expand Down

0 comments on commit e9a31f3

Please sign in to comment.