-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvitest.config.ts
More file actions
38 lines (37 loc) · 1.08 KB
/
vitest.config.ts
File metadata and controls
38 lines (37 loc) · 1.08 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
import { svelte } from "@sveltejs/vite-plugin-svelte";
import { defineConfig } from "vitest/config";
export default defineConfig({
plugins: [svelte({ hot: false })],
resolve: {
// Force Svelte client bundle (not server) when running in jsdom
conditions: ["browser"],
},
test: {
environment: "jsdom",
include: ["src/**/*.test.ts"],
globals: true,
// Mock Tauri APIs so component imports don't explode in Node
alias: {
"@tauri-apps/api/core": new URL(
"src/__mocks__/tauri-api.ts",
import.meta.url,
).pathname,
"@tauri-apps/api/event": new URL(
"src/__mocks__/tauri-event.ts",
import.meta.url,
).pathname,
"@tauri-apps/plugin-opener": new URL(
"src/__mocks__/tauri-opener.ts",
import.meta.url,
).pathname,
"@tauri-apps/plugin-notification": new URL(
"src/__mocks__/tauri-notification.ts",
import.meta.url,
).pathname,
"@tauri-apps/api/window": new URL(
"src/__mocks__/tauri-window.ts",
import.meta.url,
).pathname,
},
},
});