Files
chess-project/jest.setup.ts
T
2026-04-02 12:59:20 +02:00

16 lines
511 B
TypeScript

import '@testing-library/jest-dom'
import { PropsWithChildren } from 'react';
if (typeof window !== 'undefined') {
// Mock scrollIntoView for JSDOM
window.HTMLElement.prototype.scrollIntoView = jest.fn();
window.HTMLMediaElement.prototype.play = () => Promise.resolve();
window.HTMLMediaElement.prototype.pause = jest.fn();
}
// Mock react-markdown to avoid ESM issues in Jest
jest.mock('react-markdown', () => ({
__esModule: true,
default: ({ children }: PropsWithChildren) => children,
}));