chore: migrate to nuxt-vitest
This commit is contained in:
parent
b48b7f4c16
commit
6dbf7ae74f
12 changed files with 619 additions and 102 deletions
23
tests/nuxt/html-to-text.test.ts
Normal file
23
tests/nuxt/html-to-text.test.ts
Normal file
|
@ -0,0 +1,23 @@
|
|||
import { describe, expect, it } from 'vitest'
|
||||
|
||||
describe('html-to-text', () => {
|
||||
it('inline code', () => {
|
||||
expect(htmlToText('<p>text <code>code</code> inline</p>'))
|
||||
.toMatchInlineSnapshot('"text `code` inline"')
|
||||
})
|
||||
|
||||
it('code block', () => {
|
||||
expect(htmlToText('<p>text </p><pre><code class="language-js">code</code></pre>'))
|
||||
.toMatchInlineSnapshot(`
|
||||
"text
|
||||
\`\`\`js
|
||||
code
|
||||
\`\`\`"
|
||||
`)
|
||||
})
|
||||
|
||||
it('bold & italic', () => {
|
||||
expect(htmlToText('<p>text <b>bold</b> <em>italic</em></p>'))
|
||||
.toMatchInlineSnapshot('"text **bold** *italic*"')
|
||||
})
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue