File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed
Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -19,16 +19,24 @@ const mockAudioContext = {
1919 suspend : vi . fn ( ) ,
2020} ;
2121
22- ( global as any ) . AudioContext = vi
22+ ( global as Record < string , unknown > ) . AudioContext = vi
2323 . fn ( )
2424 . mockImplementation ( ( ) => mockAudioContext ) ;
25- ( global as any ) . webkitAudioContext = ( global as any ) . AudioContext ;
25+ ( global as Record < string , unknown > ) . webkitAudioContext = (
26+ global as Record < string , unknown >
27+ ) . AudioContext ;
2628
2729// Mock other Web APIs that might be needed
28- ( global as any ) . HTMLMediaElement . prototype . play = vi . fn ( ( ) =>
29- Promise . resolve ( ) ,
30- ) ;
31- ( global as any ) . HTMLMediaElement . prototype . pause = vi . fn ( ) ;
30+ (
31+ global as Record < string , unknown > & {
32+ HTMLMediaElement : typeof HTMLMediaElement ;
33+ }
34+ ) . HTMLMediaElement . prototype . play = vi . fn ( ( ) => Promise . resolve ( ) ) ;
35+ (
36+ global as Record < string , unknown > & {
37+ HTMLMediaElement : typeof HTMLMediaElement ;
38+ }
39+ ) . HTMLMediaElement . prototype . pause = vi . fn ( ) ;
3240
3341// Mock matchMedia for theme detection
3442Object . defineProperty ( window , "matchMedia" , {
You can’t perform that action at this time.
0 commit comments