mirror of
https://github.com/getredash/redash.git
synced 2025-12-19 17:37:19 -05:00
20 lines
475 B
JavaScript
20 lines
475 B
JavaScript
import MockDate from "mockdate";
|
|
|
|
const date = new Date("2000-01-01T02:00:00.000");
|
|
|
|
MockDate.set(date);
|
|
|
|
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(),
|
|
})),
|
|
});
|