Skip to content

Commit

Permalink
test: 100% coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
TomerAberbach committed Apr 20, 2024
1 parent f5fc7b6 commit 1dd81dc
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,34 @@ import remarkRehype from 'remark-rehype'
import rehypeStringify from 'rehype-stringify'
import { DEFAULT_ADMONITION_TYPES, remarkAdmonition } from '../src/index.js'

test(`remarkAdmonition works`, () => {
test(`remarkAdmonition works without options`, () => {
const html = String(
unified()
.use(remarkParse)
.use(remarkDirective)
.use(remarkAdmonition)
.use(remarkRehype)
.use(rehypeStringify).processSync(`
# Hello World!
:::note
Be careful folks!
:::
:::fyi[**title** time]
Wowowow!
:::
`),
)

expect(html).toMatchInlineSnapshot(`
"<h1>Hello World!</h1>
<div data-admonition-name="note" data-admonition-label="Note" role="note"><p>Be careful folks!</p></div>
<div><p><strong>title</strong> time</p><p>Wowowow!</p></div>"
`)
})

test(`remarkAdmonition works with options`, () => {
const html = String(
unified()
.use(remarkParse)
Expand Down

0 comments on commit 1dd81dc

Please sign in to comment.