From 1dd81dcc2717a0310dfc45eb73686216791b662c Mon Sep 17 00:00:00 2001 From: Tomer Aberbach Date: Sat, 20 Apr 2024 12:07:54 -0400 Subject: [PATCH] test: 100% coverage --- test/index.ts | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/test/index.ts b/test/index.ts index c68e351..a6f9e07 100644 --- a/test/index.ts +++ b/test/index.ts @@ -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(` +"

Hello World!

+

Be careful folks!

+

title time

Wowowow!

" +`) +}) + +test(`remarkAdmonition works with options`, () => { const html = String( unified() .use(remarkParse)