-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
40 lines (39 loc) · 1.33 KB
/
vitest.config.ts
File metadata and controls
40 lines (39 loc) · 1.33 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
import { defineConfig } from "vitest/config";
export default defineConfig({
test: {
// CLI tests invoke external commands that may need to wait for
// connection timeouts (database, LLM services), so use a longer timeout
testTimeout: 15000,
// Allow tests to run longer in CI environments
hookTimeout: 10000,
// Provide default environment variables for tests
env: {
DATABASE_URL: "postgresql://test:test@localhost:5432/test",
DISCORD_BOT_TOKEN: "test-token",
DISCORD_CHANNEL_ID: "test-channel",
LLM_BASE_URL: "http://localhost:8080",
LLM_MODEL: "test-model",
},
// Coverage configuration: collect coverage only for the bot/ module
coverage: {
// Use the istanbul provider for robust reports and lcov output
provider: "istanbul",
reporter: ["text", "lcov"],
reportsDirectory: "coverage",
// Include only the bot module sources for coverage measurements
include: ["src/bot/**/*.{ts,js}"],
// Exclude test files and node_modules
exclude: ["**/*.test.*", "tests/**", "node_modules/**"],
all: true,
// Enforce minimum coverage thresholds for the bot/ module
thresholds: {
global: {
statements: 80,
branches: 80,
functions: 80,
lines: 80,
},
},
},
},
});