@@ -93,7 +93,7 @@ describe('emitted', () => {
93
93
name : 'Parent' ,
94
94
setup ( props , { emit } ) {
95
95
return ( ) =>
96
- h ( Child , { onHello : ( ...events ) => emit ( 'parent' , ...events ) } )
96
+ h ( Child , { onHello : ( ...events : any [ ] ) => emit ( 'parent' , ...events ) } )
97
97
}
98
98
} )
99
99
const wrapper = mount ( Parent )
@@ -130,10 +130,10 @@ describe('emitted', () => {
130
130
expect ( wrapper . emitted ( 'hello' ) ) . toEqual ( undefined )
131
131
132
132
wrapper . find ( 'button' ) . trigger ( 'click' )
133
- expect ( wrapper . emitted ( 'hello' ) [ 0 ] ) . toEqual ( [ 'foo' , 'bar' ] )
133
+ expect ( ( wrapper . emitted ( 'hello' ) as unknown [ ] ) [ 0 ] ) . toEqual ( [ 'foo' , 'bar' ] )
134
134
135
135
wrapper . find ( 'button' ) . trigger ( 'click' )
136
- expect ( wrapper . emitted ( 'hello' ) [ 1 ] ) . toEqual ( [ 'foo' , 'bar' ] )
136
+ expect ( ( wrapper . emitted ( 'hello' ) as unknown [ ] ) [ 1 ] ) . toEqual ( [ 'foo' , 'bar' ] )
137
137
138
138
expect ( wrapper . emitted ( 'hello' ) ) . toHaveLength ( 2 )
139
139
} )
@@ -157,7 +157,7 @@ describe('emitted', () => {
157
157
158
158
wrapper . find ( 'h1' ) . trigger ( 'click' )
159
159
expect ( wrapper . emitted ( 'hello' ) ) . toHaveLength ( 1 )
160
- expect ( wrapper . emitted ( 'hello' ) [ 0 ] ) . toEqual ( [ 'foo' , 'bar' ] )
160
+ expect ( ( wrapper . emitted ( 'hello' ) as unknown [ ] ) [ 0 ] ) . toEqual ( [ 'foo' , 'bar' ] )
161
161
} )
162
162
163
163
it ( 'captures events emitted by class-style components' , ( ) => {
@@ -175,12 +175,12 @@ describe('emitted', () => {
175
175
176
176
wrapper . find ( 'h1' ) . trigger ( 'click' )
177
177
expect ( wrapper . emitted ( 'hello' ) ) . toHaveLength ( 1 )
178
- expect ( wrapper . emitted ( 'hello' ) [ 0 ] ) . toEqual ( [ 'foo' , 'bar' ] )
178
+ expect ( ( wrapper . emitted ( 'hello' ) as unknown [ ] ) [ 0 ] ) . toEqual ( [ 'foo' , 'bar' ] )
179
179
} )
180
180
181
181
it ( 'captures an event emitted in setup' , ( ) => {
182
182
const Comp = {
183
- setup ( _ , { emit } ) {
183
+ setup ( _ : Record < string , any > , { emit } : { emit : SetupContext [ 'emit' ] } ) {
184
184
emit ( 'foo' )
185
185
}
186
186
}
0 commit comments