Elffuss BraidHub

kikocis/continue public

6e4b7e9fc0a8 · 536 BRawPermalink
1import "@testing-library/jest-dom";
2
3afterEach(() => {
4 vi.clearAllMocks();
5});
6
7afterAll(() => {
8 vi.resetAllMocks();
9});
10
11// https://github.com/vitest-dev/vitest/issues/821
12Object.defineProperty(window, "matchMedia", {
13 writable: true,
14 value: vi.fn().mockImplementation((query) => ({
15 matches: false,
16 media: query,
17 onchange: null,
18 addListener: vi.fn(), // deprecated
19 removeListener: vi.fn(), // deprecated
20 addEventListener: vi.fn(),
21 removeEventListener: vi.fn(),
22 dispatchEvent: vi.fn(),
23 })),
24});