wix-style-react
Version:
18 lines (16 loc) • 483 B
JavaScript
export var register = function register() {
if (window && !window.matchMedia) {
window.matchMedia = function () {
return {
matches: false,
addListener: function addListener() {},
removeListener: function removeListener() {}
};
};
}
global.matchMedia = global.matchMedia || window.matchMedia;
};
var isTestEnv = process.env.NODE_ENV === 'test';
if (isTestEnv && typeof window !== 'undefined' && !window.matchMedia) {
register();
}