File tree Expand file tree Collapse file tree
src/renderer/utils/__tests__ Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ function setupDOM() {
99 const styles : Record < string , string > = { } ;
1010 const attrs : Record < string , string > = { } ;
1111 let dropdownValue = '' ;
12- const listeners : Record < string , Function [ ] > = { } ;
12+ const listeners : Record < string , ( ( ... args : unknown [ ] ) => void ) [ ] > = { } ;
1313
1414 // document.body.setAttribute
1515 document . body . setAttribute = vi . fn ( ( k , v ) => {
@@ -29,10 +29,12 @@ function setupDOM() {
2929 set value ( v : string ) {
3030 dropdownValue = v ;
3131 } ,
32- addEventListener : vi . fn ( ( event : string , handler : Function ) => {
33- if ( ! listeners [ event ] ) listeners [ event ] = [ ] ;
34- listeners [ event ] . push ( handler ) ;
35- } ) ,
32+ addEventListener : vi . fn (
33+ ( event : string , handler : ( ...args : unknown [ ] ) => void ) => {
34+ if ( ! listeners [ event ] ) listeners [ event ] = [ ] ;
35+ listeners [ event ] . push ( handler ) ;
36+ }
37+ ) ,
3638 } ;
3739 vi . spyOn ( document , 'getElementById' ) . mockReturnValue (
3840 dropdownEl as unknown as HTMLElement
You can’t perform that action at this time.
0 commit comments