test: add vitest-environment-nuxt
(#1186)
This commit is contained in:
parent
3513f09148
commit
bf25339bc9
15 changed files with 82 additions and 64 deletions
|
@ -1,6 +1,3 @@
|
|||
/**
|
||||
* @vitest-environment jsdom
|
||||
*/
|
||||
/* eslint-disable vue/one-component-per-file */
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import { renderToString } from 'vue/server-renderer'
|
||||
|
@ -202,10 +199,6 @@ vi.mock('vue-router', () => {
|
|||
}
|
||||
})
|
||||
|
||||
vi.mock('~/composables/dialog.ts', () => {
|
||||
return {}
|
||||
})
|
||||
|
||||
vi.mock('shiki-es', async (importOriginal) => {
|
||||
const mod = await importOriginal()
|
||||
return {
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
/**
|
||||
* @vitest-environment jsdom
|
||||
*/
|
||||
import type { mastodon } from 'masto'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { format } from 'prettier'
|
||||
import { render as renderTree } from 'ultrahtml'
|
||||
import { parseMastodonHTML, treeToText } from '~/composables/content-parse'
|
||||
|
||||
describe('html-parse', () => {
|
||||
it('empty', async () => {
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
/**
|
||||
* @vitest-environment jsdom
|
||||
*/
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { htmlToText } from '~/composables/content-parse'
|
||||
|
||||
describe('html-to-text', () => {
|
||||
it('inline code', () => {
|
||||
|
@ -13,11 +9,11 @@ describe('html-to-text', () => {
|
|||
it('code block', () => {
|
||||
expect(htmlToText('<p>text </p><pre><code class="language-js">code</code></pre>'))
|
||||
.toMatchInlineSnapshot(`
|
||||
"text
|
||||
\`\`\`js
|
||||
code
|
||||
\`\`\`"
|
||||
`)
|
||||
"text
|
||||
\`\`\`js
|
||||
code
|
||||
\`\`\`"
|
||||
`)
|
||||
})
|
||||
|
||||
it('bold & italic', () => {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import { describe, expect, it } from 'vitest'
|
||||
import { matchLanguages } from '../utils/language'
|
||||
|
||||
describe('language', () => {
|
||||
it('match language', () => {
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
/**
|
||||
* @vitest-environment jsdom
|
||||
*/
|
||||
import type { mastodon } from 'masto'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { reorderedTimeline } from '~/composables/timeline'
|
||||
|
||||
function status(id: string): mastodon.v1.Status {
|
||||
return { id } as mastodon.v1.Status
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue