-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathvitest.config.ts
More file actions
82 lines (81 loc) · 2.95 KB
/
Copy pathvitest.config.ts
File metadata and controls
82 lines (81 loc) · 2.95 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
82
import { timeouts } from '@prisma-next/test-utils';
import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
globals: true,
environment: 'node',
// Note: do not change to 'threads', it will cause the failure
// `TypeError: process.chdir() is not supported in workers`.
pool: 'forks',
maxWorkers: 1,
isolate: false,
fileParallelism: false,
testTimeout: timeouts.vitestPackageDefault,
hookTimeout: timeouts.vitestPackageDefault,
setupFiles: ['./test/setup.ts'],
env: {
CI: 'true',
},
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html'],
include: ['src/**/*.ts'],
exclude: [
'dist/**',
'test/**',
'**/*.test.ts',
'**/*.test-d.ts',
'**/*.config.ts',
'**/exports/**',
'src/cli.ts',
// Formatting/wrangling files — tested via e2e tests, not unit tests.
// The formatters/ directory was split from the former output.ts monolith.
'src/utils/formatters/emit.ts',
'src/utils/formatters/errors.ts',
'src/utils/formatters/graph-migration-mapper.ts',
'src/utils/formatters/graph-render.ts',
'src/utils/formatters/help.ts',
'src/utils/formatters/migrations.ts',
'src/utils/formatters/styled.ts',
'src/utils/formatters/verify.ts',
'src/utils/command-helpers.ts',
'src/utils/global-flags.ts',
'src/utils/terminal-ui.ts',
'src/utils/shutdown.ts',
// Command files — Commander.js setup and delegation to family instance,
// tested via e2e tests in @prisma-next/integration-tests (test/integration/test/cli.*.e2e.test.ts)
'src/commands/contract-emit.ts',
'src/commands/db-init.ts',
'src/commands/db-introspect.ts',
'src/commands/db-sign.ts',
'src/commands/db-update.ts',
'src/commands/db-verify.ts',
'src/commands/migration-apply.ts',
'src/commands/migration-plan.ts',
'src/commands/migration-show.ts',
'src/commands/migration-status.ts',
'src/commands/migration-ref.ts',
// Error factory functions — just constructors
'src/utils/cli-errors.ts',
// Config loader — mostly file I/O and error handling, tested via e2e tests
'src/config-loader.ts',
// Spinner and progress utilities — UI/UX code
'src/utils/spinner.ts',
'src/utils/progress-adapter.ts',
// Migration command scaffold — orchestration code tested via e2e tests
'src/utils/migration-command-scaffold.ts',
// Defensive error handling branches
'src/api/emit-contract.ts',
'src/load-ts-contract.ts',
// Control API — tested via integration tests (test/integration/test/control-api.test.ts)
'src/control-api/**',
],
thresholds: {
lines: 95,
branches: 95,
functions: 95,
statements: 95,
},
},
},
});