MCPcopy Create free account
hub / github.com/dailydotdev/apps / mockMatchMedia

Function mockMatchMedia

packages/shared/src/components/shell/shellMove.spec.ts:24–30  ·  view source on GitHub ↗
(reduced: () => boolean)

Source from the content-addressed store, hash-verified

22};
23
24const mockMatchMedia = (reduced: () => boolean) => {
25 window.matchMedia = jest.fn().mockImplementation((query: string) => ({
26 matches: query.includes('reduced-motion') ? reduced() : true,
27 addEventListener: jest.fn(),
28 removeEventListener: jest.fn(),
29 }));
30};
31
32const ghost = () => document.querySelector('.shell-ghost');
33

Callers 1

shellMove.spec.tsFile · 0.70

Calls 1

reducedFunction · 0.85

Tested by

no test coverage detected