diff --git a/packages/test-utils/types/index.d.ts b/packages/test-utils/types/index.d.ts index e521aa15a..d62aa6e64 100644 --- a/packages/test-utils/types/index.d.ts +++ b/packages/test-utils/types/index.d.ts @@ -104,7 +104,8 @@ export interface Wrapper extends BaseWrapper { text (): string name (): string - emitted (event?: string): { [name: string]: Array> } + emitted (): { [name: string]: Array> } + emitted (event: string): Array emittedByOrder (): Array<{ name: string, args: Array }> } diff --git a/packages/test-utils/types/test/wrapper.ts b/packages/test-utils/types/test/wrapper.ts index c92baa9b8..816ebeeae 100644 --- a/packages/test-utils/types/test/wrapper.ts +++ b/packages/test-utils/types/test/wrapper.ts @@ -26,8 +26,8 @@ bool = wrapper.isVueInstance() wrapper.vm.$emit('hello') -const emitted = wrapper.emitted() -const arr: Array = emitted.hello +let n: number = wrapper.emitted().hello[0][0] +let o: string = wrapper.emitted('hello')[0] const emittedByOrder = wrapper.emittedByOrder() const name: string = emittedByOrder[0].name