docs: fix type checking of component testing blocks

This commit is contained in:
Daniel Roe 2024-05-12 09:47:15 +01:00
parent bd07021405
commit b5e35e3bd7
No known key found for this signature in database
GPG Key ID: 3714AB03996F442B
1 changed files with 8 additions and 0 deletions

View File

@ -161,6 +161,10 @@ export default defineVitestConfig({
```ts twoslash
import { it, expect } from 'vitest'
import type { Component } from 'vue'
declare module '#components' {
export const SomeComponent: Component
}
// ---cut---
// tests/components/SomeComponents.nuxt.spec.ts
import { mountSuspended } from '@nuxt/test-utils/runtime'
@ -207,6 +211,10 @@ Examples:
```ts twoslash
import { it, expect } from 'vitest'
import type { Component } from 'vue'
declare module '#components' {
export const SomeComponent: Component
}
// ---cut---
// tests/components/SomeComponents.nuxt.spec.ts
import { renderSuspended } from '@nuxt/test-utils/runtime'