File tree Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ export class DOMWrapper<ElementType extends Element> {
24
24
attributes ( key : string ) : string
25
25
attributes ( key ?: string ) : { [ key : string ] : string } | string {
26
26
const attributes = this . element . attributes
27
- const attributeMap : { [ key : string ] : string } = { }
27
+ const attributeMap : Record < string , string > = { }
28
28
for ( let i = 0 ; i < attributes . length ; i ++ ) {
29
29
const att = attributes . item ( i ) !
30
30
attributeMap [ att . localName ] = att . value
Original file line number Diff line number Diff line change @@ -45,7 +45,9 @@ export class VueWrapper<T extends ComponentPublicInstance> {
45
45
return this . componentVM
46
46
}
47
47
48
- props ( selector ?: string ) {
48
+ props ( ) : { [ key : string ] : any }
49
+ props ( selector : string ) : any
50
+ props ( selector ?: string ) : { [ key : string ] : any } | any {
49
51
const props = this . componentVM . $props as { [ key : string ] : any }
50
52
return selector ? props [ selector ] : props
51
53
}
Original file line number Diff line number Diff line change @@ -98,3 +98,7 @@ expectType<Array<string>>(wrapper.classes())
98
98
expectType < boolean > ( wrapper . classes ( 'class' ) )
99
99
expectType < Array < string > > ( domWrapper . classes ( ) )
100
100
expectType < boolean > ( domWrapper . classes ( 'class' ) )
101
+
102
+ // props
103
+ expectType < { [ key : string ] : any } > ( wrapper . props ( ) )
104
+ expectType < any > ( wrapper . props ( 'prop' ) )
You can’t perform that action at this time.
0 commit comments