-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathjest.setup.ts
More file actions
50 lines (41 loc) · 1.03 KB
/
Copy pathjest.setup.ts
File metadata and controls
50 lines (41 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import "@testing-library/jest-dom";
jest.mock("@tauri-apps/api/core", () => ({
invoke: jest.fn(),
}));
jest.mock("@tauri-apps/api/event", () => ({
listen: jest.fn().mockResolvedValue(() => undefined),
}));
jest.mock("@tauri-apps/plugin-dialog", () => ({
save: jest.fn(),
}));
jest.mock("@tauri-apps/plugin-fs", () => ({
writeTextFile: jest.fn(),
}));
jest.mock("@tauri-apps/plugin-opener", () => ({
openUrl: jest.fn(),
}));
jest.mock("@tauri-apps/plugin-os", () => ({
locale: jest.fn(),
}));
jest.mock("@tauri-apps/plugin-updater", () => ({
check: jest.fn(),
}));
jest.mock("@tauri-apps/plugin-process", () => ({
relaunch: jest.fn(),
exit: jest.fn(),
}));
if (!window.matchMedia) {
Object.defineProperty(window, "matchMedia", {
writable: true,
value: (query: string) => ({
matches: false,
media: query,
onchange: null,
addListener: jest.fn(),
removeListener: jest.fn(),
addEventListener: jest.fn(),
removeEventListener: jest.fn(),
dispatchEvent: jest.fn(),
}),
});
}