File tree Expand file tree Collapse file tree 3 files changed +12
-10
lines changed
Expand file tree Collapse file tree 3 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -172,3 +172,13 @@ export function write(file, contents) {
172172
173173 fs . writeFileSync ( file , contents ) ;
174174}
175+
176+ // @ts -expect-error JS DOM doesn't support it
177+ Window . prototype . matchMedia = ( media ) => {
178+ return {
179+ matches : false ,
180+ media,
181+ addEventListener : ( ) => { } ,
182+ removeEventListener : ( ) => { }
183+ } ;
184+ } ;
Original file line number Diff line number Diff line change 1+ // @vitest -environment jsdom
2+ import '../helpers.js' ; // for the matchMedia polyfill
13import { describe , it , assert } from 'vitest' ;
24import { get } from 'svelte/store' ;
35import { spring , tweened } from 'svelte/motion' ;
Original file line number Diff line number Diff line change @@ -478,13 +478,3 @@ export function ok(value: any): asserts value {
478478 throw new Error ( `Expected truthy value, got ${ value } ` ) ;
479479 }
480480}
481-
482- // @ts -expect-error JS DOM doesn't support it
483- Window . prototype . matchMedia = ( media ) => {
484- return {
485- matches : false ,
486- media,
487- addEventListener : ( ) => { } ,
488- removeEventListener : ( ) => { }
489- } ;
490- } ;
You can’t perform that action at this time.
0 commit comments