Repository navigation
Expand file tree
/
Copy pathvitest.config.ts
More file actions
81 lines (79 loc) · 3.18 KB
/
Copy pathvitest.config.ts
File metadata and controls
81 lines (79 loc) · 3.18 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import { defineConfig } from "vitest/config";
import react from "@vitejs/plugin-react";
import path from "path";
import { isolatedDataDirEnv } from "./tests/_setup/vitestDataDir";
export default defineConfig({
test: {
environment: "jsdom",
// jsdom + React suites routinely need 5–7 s on the shared hosted runner (Release-Green
// 2026-10-28: 8 UI tests "timed out in 5000ms" that pass in ~1 s locally).
testTimeout: 20000,
globals: true,
setupFiles: ["./tests/_setup/vitestUiPolyfills.ts"],
// A throwaway DATA_DIR for the run, so no suite can reach the developer's ~/.omniroute.
env: isolatedDataDirEnv(),
globalSetup: ["./tests/_setup/vitestDataDir.ts"],
pool: "threads",
maxWorkers: 20,
fileParallelism: true,
maxConcurrency: 20,
include: [
"src/app/**/dashboard/cache/__tests__/**/*.test.tsx",
"src/app/**/dashboard/endpoint/__tests__/**/*.test.tsx",
"src/app/**/dashboard/providers/**/__tests__/**/*.test.tsx",
"src/app/**/dashboard/webhooks/__tests__/**/*.test.tsx",
"src/app/**/dashboard/discovery/__tests__/**/*.test.tsx",
"src/shared/hooks/__tests__/**/*.test.tsx",
"src/lib/memory/__tests__/**/*.test.ts",
"src/lib/skills/__tests__/**/*.test.ts",
"tests/unit/**/*.test.tsx",
"open-sse/**/__tests__/**/*.test.ts",
"open-sse/services/**/__tests__/**/*.test.ts",
],
exclude: [
// Standard Vitest / tooling exclusions
"node_modules/**",
"dist/**",
"cypress/**",
".idea/**",
".git/**",
".cache/**",
// Live-server E2E — these drive a real running server, so they must never run
// in this jsdom job. They have their own runners + vitest.e2e-live.config.ts.
"tests/e2e/ecosystem.test.ts",
"tests/e2e/protocol-clients.test.ts",
],
coverage: {
reportsDirectory: "coverage",
},
},
plugins: [react()],
resolve: {
alias: {
// Optional native embeddings are outside the UI unit-test runtime.
"@huggingface/transformers": path.resolve(
__dirname,
"./tests/_setup/transformersUnavailable.ts"
),
"@": path.resolve(__dirname, "./src"),
// Mirrors tsconfig paths. Without it, a UI test importing from open-sse
// resolves to undefined instead of failing loudly — which silently made
// every provider look credentialed in the free-tier card tests.
"@omniroute/open-sse": path.resolve(__dirname, "./open-sse"),
// Package exports whose file name differs from the subpath (packages/ui-kit/package.json
// "exports"). They must precede the prefix entry below: the first matching alias wins,
// and the prefix would send `@omniroute/ui-kit/styles.css` to a src/styles.css that does
// not exist (#18079).
"@omniroute/ui-kit/styles.css": path.resolve(
__dirname,
"./packages/ui-kit/src/ci-styles.css"
),
"@omniroute/ui-kit/tokens.css": path.resolve(
__dirname,
"./packages/ui-kit/src/ci-tokens.css"
),
"@omniroute/ui-kit/brand": path.resolve(__dirname, "./packages/ui-kit/src/keak-brand.tsx"),
"@omniroute/ui-kit": path.resolve(__dirname, "./packages/ui-kit/src"),
},
},
});