Skip to content

Commit 31fea34

Browse files
committed
Add unit test for author tag parsing
1 parent 931cf76 commit 31fea34

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

__tests__/index.spec.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ describe(`#getLinkPreview()`, () => {
3131
expect(linkInfo.charset?.toLowerCase()).toEqual(`utf-8`);
3232
});
3333

34+
it("should extract author from news article", async () => {
35+
const linkInfo: any = await getLinkPreview(
36+
`https://www.usatoday.com/story/special/contributor-content/2025/10/15/why-chaos-engineering-is-more-important-than-ever-in-the-ai-era/86712877007/`
37+
);
38+
39+
expect(linkInfo.author).toEqual(`Matt Emma`);
40+
})
41+
3442
it(`should extract link info from a URL with a newline`, async () => {
3543
const linkInfo: any = await getLinkPreview(
3644
`

0 commit comments

Comments
 (0)