-
-
Notifications
You must be signed in to change notification settings - Fork 269
Expand file tree
/
Copy pathvitest.config.ts
More file actions
31 lines (29 loc) · 1.18 KB
/
Copy pathvitest.config.ts
File metadata and controls
31 lines (29 loc) · 1.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
import { defineConfig } from 'vitest/config'
// CockroachDB and YugabyteDB pay heavy online-DDL/schema-rebuild costs per test, which blow the
// PostgreSQL-tuned 10s budget. Give the whole suite more headroom when running against a distributed
// backend so the compatibility runs report real failures instead of timeouts.
const isDistributedBackend = process.env.DB_TYPE === 'cockroachdb' || process.env.DB_TYPE === 'yugabytedb'
const testTimeout = isDistributedBackend ? 60000 : 10000
const hookTimeout = isDistributedBackend ? 60000 : 10000
export default defineConfig({
test: {
testTimeout,
hookTimeout,
include: ['test/**/*Test.ts'],
globalSetup: ['./test/checkDuplicateTestNames.ts'],
setupFiles: ['./test/hooks.ts'],
globals: true,
typecheck: {
enabled: true,
include: ['test/**/*TypeTest.ts'],
tsconfig: './tsconfig.typecheck.json'
},
coverage: {
reporter: ['lcov', 'text-summary', 'text'],
include: ['src/**/*.ts'],
// cli.ts is tested via subprocess execution (child_process.exec), which runs
// in a separate Node.js process not instrumented by vitest's coverage tools
exclude: ['src/cli.ts']
}
}
})