Browse Source

Update matchMedia shim

Steven Silvester 4 years ago
parent
commit
92374e435f
1 changed files with 7 additions and 1 deletions
  1. 7 1
      testutils/src/jest-shim.ts

+ 7 - 1
testutils/src/jest-shim.ts

@@ -63,7 +63,13 @@ if (!window.hasOwnProperty('getSelection')) {
 (window as any).matchMedia = function(media: string) {
   return {
     matches: false,
-    media
+    media,
+    addEventListener: () => {
+      /* empty */
+    },
+    removeEventListener: () => {
+      /* empty */
+    }
   };
 };