Skip to content

Commit

Permalink
fix: improve emitted type (#933)
Browse files Browse the repository at this point in the history
  • Loading branch information
eddyerburgh authored Aug 19, 2018
1 parent af45a9d commit 3049c3e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/test-utils/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ export interface Wrapper<V extends Vue | null> extends BaseWrapper {
text (): string
name (): string

emitted (event?: string): { [name: string]: Array<Array<any>> }
emitted (): { [name: string]: Array<Array<any>> }
emitted (event: string): Array<any>
emittedByOrder (): Array<{ name: string, args: Array<any> }>
}

Expand Down
4 changes: 2 additions & 2 deletions packages/test-utils/types/test/wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ bool = wrapper.isVueInstance()

wrapper.vm.$emit('hello')

const emitted = wrapper.emitted()
const arr: Array<any> = 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
Expand Down

0 comments on commit 3049c3e

Please sign in to comment.