-
-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathvitest.config.ts
More file actions
57 lines (55 loc) · 1.5 KB
/
Copy pathvitest.config.ts
File metadata and controls
57 lines (55 loc) · 1.5 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
51
52
53
54
55
56
57
import path from "node:path"
import react from "@vitejs/plugin-react"
import { defineConfig } from "vitest/config"
const THREAD_TEST_PATTERNS = [
"src/features/chat/hooks/__tests__/use-embedding-migration.test.ts",
"src/lib/__tests__/backup-service.test.ts",
"src/lib/persistence/**/__tests__/*.{test,spec}.{ts,tsx}",
"src/lib/repositories/__tests__/{chat-history-facade,sqlite-chat-history}.test.ts",
"src/lib/sqlite/**/__tests__/*.{test,spec}.{ts,tsx}",
"src/lib/storage/__tests__/{backup-import-transaction,provider-migration}.test.ts"
]
export default defineConfig({
plugins: [react()],
test: {
globals: true,
environment: "happy-dom",
setupFiles: ["./src/test/setup.ts"],
projects: [
{
extends: true,
test: {
name: "unit-vm",
pool: "vmThreads",
maxWorkers: 6,
vmMemoryLimit: "256MB",
include: [
"src/**/*.{test,spec}.{ts,tsx}",
"config/**/*.{test,spec}.ts"
],
exclude: THREAD_TEST_PATTERNS
}
},
{
extends: true,
test: {
name: "persistence",
pool: "threads",
maxWorkers: 6,
include: THREAD_TEST_PATTERNS
}
}
],
coverage: {
provider: "v8",
reporter: ["text", "json", "html", "lcov"],
include: ["src/**/*.ts"],
exclude: ["src/**/*.{test,spec}.{ts,tsx}", "src/**/*.d.ts"]
}
},
resolve: {
alias: {
"@": path.resolve(__dirname, "./src")
}
}
})