/** * @vitest-environment jsdom */ import { describe, expect, it } from 'vitest' import { htmlToText } from '~/composables/content-parse' describe('html-to-text', () => { it('inline code', () => { expect(htmlToText('
text code
inline
text
code
'))
.toMatchInlineSnapshot(`
"text
\`\`\`js
code
\`\`\`"
`)
})
it('bold & italic', () => {
expect(htmlToText('text bold italic
')) .toMatchInlineSnapshot('"text **bold** *italic*"') }) })