fedimovies-web/tests/unit/markdown.spec.ts

11 lines
540 B
TypeScript
Raw Permalink Normal View History

2021-04-17 03:16:54 +00:00
import { expect } from "chai"
import { renderMarkdownLite } from "@/utils/markdown"
describe("Render markdown", () => {
it("Render markdown lite", () => {
2022-01-28 00:31:10 +00:00
const text = "test **bold** ~~strike~~ with `code`, <span>html</span> and https://example.com\nand a new line"
2021-04-17 03:16:54 +00:00
const html = renderMarkdownLite(text)
2022-01-28 00:31:10 +00:00
expect(html).to.equal('test **bold** ~~strike~~ with <code>code</code>, &lt;span&gt;html&lt;/span&gt; and <a href="https://example.com" target="_blank" rel="noopener">https://example.com</a><br>\nand a new line')
2021-04-17 03:16:54 +00:00
})
})