Skip to content

Commit

Permalink
fix(types): emitted can return undefined (#1431)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaswerkmeister authored Feb 12, 2020
1 parent 775feb7 commit b41a09d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/test-utils/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ export interface Wrapper<V extends Vue | null> extends BaseWrapper {
text (): string
name (): string

emitted (): { [name: string]: Array<Array<any>> }
emitted (event: string): Array<any>
emitted (): { [name: string]: Array<Array<any>>|undefined }
emitted (event: string): Array<any>|undefined
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 @@ -23,8 +23,8 @@ bool = wrapper.isVueInstance()

wrapper.vm.$emit('hello')

let n: number = wrapper.emitted().hello[0][0]
let o: string = wrapper.emitted('hello')[0]
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 b41a09d

Please sign in to comment.