mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-14 21:12:53 +00:00
23 lines
542 B
TypeScript
23 lines
542 B
TypeScript
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(),
|
|
})),
|
|
});
|
|
|
|
Object.defineProperty(window, 'React', {
|
|
writable: true,
|
|
value: {},
|
|
});
|
|
|
|
window.scrollTo = () => {};
|
|
window.console.warn = () => {};
|
|
window.React = window.React || {};
|