summary: add link/anchor element

This commit is contained in:
Rob Herley committed 2022-03-02 12:10:01 -05:00
1 parent 3b0329b605
commit 2660585298
2 files changed
+26

No files matched your search

+12
View File
@@ -60,6 +60,10 @@ const fixtures = {
quote: {
text: 'Where the world builds software',
cite: 'https://github.com/about'
},
link: {
text: 'GitHub',
href: 'https://github.com/'
}
}
@@ -237,4 +241,12 @@ describe('@actions/core/src/markdown-summary', () => {
const expected = `<blockquote cite="https://github.com/about">Where the world builds software</blockquote>${os.EOL}`
await assertSummary(expected)
})
it('adds a link with href', async () => {
await markdownSummary
.addLink(fixtures.link.text, fixtures.link.href)
.write()
const expected = `<a href="https://github.com/">GitHub</a>${os.EOL}`
await assertSummary(expected)
})
})