Skip to content

Commit

Permalink
test(post): cover get post excerpt
Browse files Browse the repository at this point in the history
  • Loading branch information
louisgrasset committed Oct 23, 2023
1 parent 73e6895 commit e7f7f16
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/helpers/post/__tests__/get-post-excerpt.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { getPostExcerpt } from "../get-post-excerpt.js";

describe("getPostExcerpt", () => {
it("should return the 25 first characters and remove break lines", () => {
const result = getPostExcerpt(
"This is a test from\n the Potato Inc. tech lead",
);
expect(result).toBe("« This is a test from the P... »");
});
});

0 comments on commit e7f7f16

Please sign in to comment.