|
1 | 1 | // Minimum TypeScript Version: 4.0
|
2 | 2 | /* eslint-disable @typescript-eslint/no-explicit-any */
|
3 | 3 |
|
4 |
| -import { VNodeChild } from 'vue'; |
5 |
| -import { MountingOptions } from '@vue/test-utils' |
6 |
| -import { queries, EventType, BoundFunctions } from '@testing-library/dom' |
| 4 | +import {VNodeChild} from 'vue' |
| 5 | +import {MountingOptions} from '@vue/test-utils' |
| 6 | +import {queries, EventType, BoundFunctions} from '@testing-library/dom' |
7 | 7 | // eslint-disable-next-line import/no-extraneous-dependencies
|
8 |
| -import { OptionsReceived as PrettyFormatOptions } from 'pretty-format' |
9 |
| -import type { ComponentProps, ComponentSlots } from "vue-component-type-helpers"; |
10 |
| -import { RemoveIndexSignature } from "type-fest"; |
| 8 | +import {OptionsReceived as PrettyFormatOptions} from 'pretty-format' |
| 9 | +import {ComponentProps, ComponentSlots} from 'vue-component-type-helpers' |
| 10 | +import {RemoveIndexSignature} from 'type-fest' |
11 | 11 |
|
12 | 12 | // NOTE: fireEvent is overridden below
|
13 | 13 | export * from '@testing-library/dom'
|
@@ -48,16 +48,20 @@ interface VueTestingLibraryRenderOptions {
|
48 | 48 | baseElement?: Element
|
49 | 49 | }
|
50 | 50 |
|
51 |
| - |
52 | 51 | type AllowNonFunctionSlots<Slots> = {
|
53 |
| - [K in keyof Slots]: Slots[K] | VNodeChild; |
54 |
| -}; |
55 |
| -type ExtractSlots<C> = AllowNonFunctionSlots<Partial<RemoveIndexSignature<ComponentSlots<C>>>>; |
| 52 | + [K in keyof Slots]: Slots[K] | VNodeChild |
| 53 | +} |
| 54 | +type ExtractSlots<C> = AllowNonFunctionSlots< |
| 55 | + Partial<RemoveIndexSignature<ComponentSlots<C>>> |
| 56 | +> |
56 | 57 |
|
57 |
| -export interface RenderOptions<C> extends Omit<VueTestingLibraryRenderOptions & VueTestUtilsRenderOptions |
58 |
| - , "props" | "slots"> { |
59 |
| - props?: ComponentProps<C>; |
60 |
| - slots?: ExtractSlots<C>; |
| 58 | +export interface RenderOptions<C> |
| 59 | + extends Omit< |
| 60 | + VueTestingLibraryRenderOptions & VueTestUtilsRenderOptions, |
| 61 | + 'props' | 'slots' |
| 62 | + > { |
| 63 | + props?: ComponentProps<C> |
| 64 | + slots?: ExtractSlots<C> |
61 | 65 | }
|
62 | 66 |
|
63 | 67 | export function render<C>(
|
|
0 commit comments