-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
63 lines (61 loc) · 1.61 KB
/
vitest.config.ts
File metadata and controls
63 lines (61 loc) · 1.61 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
/**
* Vitest configuration for this repository (Node environment with a fork pool).
* Uses forks to allow suites to safely call `process.chdir()`.
* @module
*/
import { defineConfig } from 'vitest/config';
import { fileURLToPath } from 'node:url';
import { dirname, resolve } from 'node:path';
const rootDir = dirname(fileURLToPath(import.meta.url));
/**
* Default Vitest configuration for local development and CI.
*/
export default defineConfig({
resolve: {
alias: {
'@': resolve(rootDir, 'src'),
},
},
test: {
globals: true,
environment: 'node',
// Use forks to allow process.chdir in suites that rely on it.
pool: 'forks',
// Ensure stan-core is processed by Vitest so mocks apply correctly.
server: {
deps: {
inline: ['@karmaniverous/stan-core', 'tar'],
},
},
exclude: ['node_modules/**', 'dist/**', '.rollup.cache/**'],
coverage: {
provider: 'v8',
reporter: ['text', 'lcov'],
include: ['src/**/*.ts'],
exclude: [
'src/**/*.test.ts',
'src/test/**',
'**/*.d.ts',
// Exclude trivial barrels and types-only modules from coverage noise
'src/index.ts',
'src/runner/index.ts',
'src/runner/config/index.ts',
'src/runner/run/index.ts',
'src/runner/patch/index.ts',
'src/runner/config/types.ts',
'src/runner/run/types.ts',
],
},
reporters: [
[
'default',
{
summary: false,
},
],
],
setupFiles: [resolve(rootDir, 'src/test/setup.ts')],
testTimeout: 30000,
hookTimeout: 10000,
},
});