-
Notifications
You must be signed in to change notification settings - Fork 643
Expand file tree
/
Copy pathvitest.config.ts
More file actions
76 lines (63 loc) · 2.36 KB
/
Copy pathvitest.config.ts
File metadata and controls
76 lines (63 loc) · 2.36 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
import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
// Test files follow the pattern *.test.ts (new Vitest tests)
include: ['tests/**/*.test.ts'],
// Exclude adapter-specific smoke tests, ioredis-specific tests, and legacy files.
// The adapter-agnostic suite must be identical for ioredis, node-redis, and bun.
// ioredis-specific tests (cluster, connection, sandboxed_process) run separately
// via test:ioredis.
exclude: [
// ioredis-specific tests (direct ioredis imports / cluster / connection internals)
'tests/cluster.test.ts',
'tests/connection.test.ts',
'tests/sandboxed_process.test.ts',
// Adapter-specific smoke tests (self-contained, not factory-based)
'tests/node-redis.test.ts',
'tests/adapter-conformance.test.ts',
'tests/bun-redis.test.ts',
'tests/bun-adapter-suite.test.ts',
// Old mocha-era files
'tests/test_*.ts',
// Debug/scratch files
'tests/debug-*.test.ts',
'node_modules/**',
],
// Global test timeout
testTimeout: 10000,
// Hook timeout
hookTimeout: 10000,
// Setup files (equivalent to mocha.setup.ts)
setupFiles: ['./vitest.setup.ts'],
// Run tests sequentially by default (can be overridden with --parallel)
// This is important for Redis-based tests to avoid conflicts
sequence: {
concurrent: false,
},
// Reporter
reporters: ['verbose'],
// Coverage configuration.
//
// NOTE: `yarn coverage` uses `vitest.coverage.config.ts`, which runs the
// union of the default and ioredis-only suites so adapter-agnostic and
// ioredis-specific code paths (sandboxed_process, cluster, connection)
// are both included. The settings here only apply to ad-hoc invocations
// of `vitest --coverage` against this default config and intentionally
// exclude modules that have no coverage in this suite.
coverage: {
provider: 'v8',
include: ['src/**/*.ts'],
exclude: ['src/enums/*.ts', 'src/interfaces/*.ts'],
reporter: ['text', 'lcov'],
// Coverage thresholds (migrated from c8 config)
thresholds: {
lines: 80,
functions: 80,
branches: 70,
statements: 80,
},
},
// Globals (describe, it, expect, etc.) - we'll use explicit imports instead
globals: false,
},
});