Skip to content

Commit 4a80b48

Browse files
committed
fix: betetr "emitted" types
1 parent adeef14 commit 4a80b48

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "vitest-browser-vue",
33
"type": "module",
4-
"version": "0.0.0",
4+
"version": "0.0.1",
55
"description": "Wrapper around @vue/test-utils for Vitest's Browser Mode",
66
"author": "Vitest Team",
77
"license": "MIT",

src/pure.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ const mountedWrappers = new Set<VueWrapper>()
1212
export interface Screen<Props> extends LocatorSelectors {
1313
container: HTMLElement
1414
baseElement: HTMLElement
15-
debug: (el?: HTMLElement | HTMLElement[] | Locator | Locator[], maxLength?: number, options?: PrettyFormatOptions) => void
16-
unmount: () => void
17-
html: () => string
18-
emitted: (name: string) => any
19-
rerender: (props: Partial<Props>) => void
15+
debug(el?: HTMLElement | HTMLElement[] | Locator | Locator[], maxLength?: number, options?: PrettyFormatOptions): void
16+
unmount(): void
17+
html(): string
18+
emitted<T = unknown>(): Record<string, T[]>;
19+
emitted<T = unknown[]>(eventName: string): undefined | T[];
20+
rerender(props: Partial<Props>): void
2021
}
2122

2223
export interface ComponentRenderOptions<C, P extends ComponentProps<C>> extends Omit<ComponentMountingOptions<C, P>, 'attachTo'> {

0 commit comments

Comments
 (0)