Skip to content

Commit 7c3fb02

Browse files
committed
test polyfill
1 parent 9da3a10 commit 7c3fb02

File tree

1 file changed

+10
-0
lines changed
  • packages/svelte/tests/runtime-legacy

1 file changed

+10
-0
lines changed

packages/svelte/tests/runtime-legacy/shared.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,3 +478,13 @@ 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+
};

0 commit comments

Comments
 (0)