// Brings in toBeInTheDocument and friends. The package was already a devDependency but its // matchers were never registered, so component tests could not use them. import '@testing-library/jest-dom'; jest.mock('app/environment'); // jsdom ships no matchMedia; the window fade code (app/stores/window/reveal.ts) calls it to // check prefers-reduced-motion. Default to "motion allowed"; individual tests can override. if (!window.matchMedia) { window.matchMedia = ((query: string) => ({ matches: false, media: query, onchange: null, addListener: jest.fn(), removeListener: jest.fn(), addEventListener: jest.fn(), removeEventListener: jest.fn(), dispatchEvent: jest.fn(), })) as unknown as typeof window.matchMedia; } // The real ticker starts a live interval and pokes the legacy YUI layer; the manual mock // at app/stores/__mocks__/ticker.ts is inert and test-driven. Any component that mounts a // transitively needs this. jest.mock('app/stores/ticker'); // // Suppress console messages in testing // global.console = { ...console, log: jest.fn(), debug: jest.fn(), info: jest.fn(), warn: jest.fn(), error: jest.fn(), };