# All files / test-utils/polyfills matchMedia.ts

62.5% Statements 5/8
100% Branches 2/2
0% Functions 0/1
62.5% Lines 5/8

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    1
    2
    3
    4
    5
    6
    7
    8
    91x
    1x
    1x
    1x

    1x
     import { BASE_MEDIA_QUERY_LIST, matchDesktop } from "../matchMedia";

    if (typeof window !== "undefined" && typeof window.matchMedia !== "function") {
      window.matchMedia = (query) => ({
        ...BASE_MEDIA_QUERY_LIST,
        matches: matchDesktop(query),
      });
    }