-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
61 lines (60 loc) · 1.81 KB
/
Copy pathvitest.config.ts
File metadata and controls
61 lines (60 loc) · 1.81 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
import { defineConfig } from 'vitest/config'
// Note: `resolve.tsconfigPaths` is configured per-project below. When
// `projects` is defined, the root-level `resolve` block is ignored by Vitest,
// so duplicating it here would be dead config.
export default defineConfig({
test: {
coverage: {
provider: 'v8',
reporter: ['text', 'lcov'],
include: ['src/**/*.{ts,tsx}'],
exclude: [
'src/**/*.test.ts',
'src/**/*.d.ts',
'src/db/migrations/**',
'src/components/**',
],
},
projects: [
{
resolve: {
tsconfigPaths: true,
},
test: {
name: 'unit',
environment: 'node',
include: ['test/unit/**/*.test.ts'],
sequence: {
// Run unit tests before integration tests when both projects run.
groupOrder: 0,
},
},
},
{
resolve: {
tsconfigPaths: true,
},
test: {
name: 'integration',
environment: 'node',
include: ['test/integration/**/*.test.ts'],
globalSetup: ['./test/integration/globalSetup.ts'],
setupFiles: ['./test/integration/setup.ts'],
testTimeout: 30_000,
hookTimeout: 120_000,
// One worker so the container URL set in globalSetup is inherited
// and all integration tests share a single DB container.
pool: 'forks',
// Disable parallel execution so separate test files can't collide
// on the shared test DB (e.g., concurrent inserts to qb_portal_connections).
fileParallelism: false,
isolate: false,
sequence: {
// Run integration tests after unit tests when both projects run.
groupOrder: 1,
},
},
},
],
},
})