Skip to content

Commit b5e35e3

Browse files
committed
docs: fix type checking of component testing blocks
1 parent bd07021 commit b5e35e3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

docs/1.getting-started/11.testing.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,10 @@ export default defineVitestConfig({
161161

162162
```ts twoslash
163163
import { it, expect } from 'vitest'
164+
import type { Component } from 'vue'
165+
declare module '#components' {
166+
export const SomeComponent: Component
167+
}
164168
// ---cut---
165169
// tests/components/SomeComponents.nuxt.spec.ts
166170
import { mountSuspended } from '@nuxt/test-utils/runtime'
@@ -207,6 +211,10 @@ Examples:
207211

208212
```ts twoslash
209213
import { it, expect } from 'vitest'
214+
import type { Component } from 'vue'
215+
declare module '#components' {
216+
export const SomeComponent: Component
217+
}
210218
// ---cut---
211219
// tests/components/SomeComponents.nuxt.spec.ts
212220
import { renderSuspended } from '@nuxt/test-utils/runtime'

0 commit comments

Comments
 (0)