Skip to content

Commit

Permalink
test: work around mocking issue
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Jul 31, 2023
1 parent 3d69664 commit 5870e8d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/nuxt/content-rich.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { describe, expect, it, vi } from 'vitest'
// TODO: fix shadowing of `vi` import
import { vi as _vi, describe, expect, it } from 'vitest'
import { renderToString } from 'vue/server-renderer'
import { format } from 'prettier'
import type { mastodon } from 'masto'
Expand Down Expand Up @@ -270,7 +271,7 @@ async function render(content: string, options?: ContentParseOptions) {
}

// mocks
vi.mock('vue-router', async () => {
_vi.mock('vue-router', async () => {
const { defineComponent, h } = await import('vue')
return {
RouterLink: defineComponent((attrs) => {
Expand All @@ -279,7 +280,7 @@ vi.mock('vue-router', async () => {
}
})

vi.mock('shiki-es', async (importOriginal) => {
_vi.mock('shiki-es', async (importOriginal) => {
const mod = await importOriginal()
return {
...(mod as any),
Expand Down

0 comments on commit 5870e8d

Please sign in to comment.