react-fblibrary
Version:
FBLibrary é uma biblioteca autoral que reúne componentes e bases fundamentais para desenvolvimento eficiente. Nosso objetivo é criar um ecossistema de componentes, desde elementos simples, como inputs e botões, até layouts completos, que podem ser reutili
24 lines (18 loc) • 524 B
JavaScript
import matchMedia from 'match-media-mock';
// Mock the window.matchMedia function
const originalMatchMedia = window.matchMedia;
const mockMatchMedia = matchMedia.create();
beforeAll(() => {
window.matchMedia = mockMatchMedia;
});
afterAll(() => {
window.matchMedia = originalMatchMedia;
});
export const setMatchMediaMock = () => {
beforeAll(() => {
window.matchMedia = mockMatchMedia;
});
afterAll(() => {
window.matchMedia = originalMatchMedia;
});
};