UNPKG

react-theme-system

Version:

A comprehensive React theme management system that enforces consistency, supports dark/light mode, and eliminates hardcoded styles

41 lines (40 loc) 1.24 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); require("@testing-library/jest-dom"); // Mock window.matchMedia for responsive tests Object.defineProperty(window, 'matchMedia', { writable: true, value: jest.fn().mockImplementation(query => ({ matches: false, media: query, onchange: null, addListener: jest.fn(), // deprecated removeListener: jest.fn(), // deprecated addEventListener: jest.fn(), removeEventListener: jest.fn(), dispatchEvent: jest.fn(), })), }); // Mock ResizeObserver Object.defineProperty(global, 'ResizeObserver', { writable: true, value: jest.fn().mockImplementation(() => ({ observe: jest.fn(), unobserve: jest.fn(), disconnect: jest.fn(), })), }); // Suppress console warnings in tests unless explicitly testing them const originalWarn = console.warn; beforeAll(() => { console.warn = (...args) => { if (typeof args[0] === 'string' && args[0].includes('Warning: ReactDOM.render is no longer supported')) { return; } originalWarn.call(console, ...args); }; }); afterAll(() => { console.warn = originalWarn; });