forked from steipete/summarize
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
79 lines (77 loc) · 2.33 KB
/
Copy pathvitest.config.ts
File metadata and controls
79 lines (77 loc) · 2.33 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
import { cpus } from 'node:os'
import { dirname, resolve } from 'node:path'
import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vitest/config'
const rootDir = dirname(fileURLToPath(import.meta.url))
const cpuCount = Math.max(1, cpus().length)
const envMaxThreads = Number.parseInt(process.env.VITEST_MAX_THREADS ?? '', 10)
const maxThreads = Number.isFinite(envMaxThreads)
? envMaxThreads
: Math.min(8, Math.max(4, Math.floor(cpuCount / 2)))
const coverageReporters = process.env.CI
? ['text', 'json-summary', 'html']
: ['text', 'json-summary']
export default defineConfig({
poolOptions: {
threads: {
minThreads: 1,
maxThreads,
},
},
resolve: {
alias: [
{
find: /^@steipete\/summarize-core\/content$/,
replacement: resolve(rootDir, 'packages/core/src/content/index.ts'),
},
{
find: /^@steipete\/summarize-core\/content\/url$/,
replacement: resolve(rootDir, 'packages/core/src/content/url.ts'),
},
{
find: /^@steipete\/summarize-core\/prompts$/,
replacement: resolve(rootDir, 'packages/core/src/prompts/index.ts'),
},
{
find: /^@steipete\/summarize-core\/language$/,
replacement: resolve(rootDir, 'packages/core/src/language.ts'),
},
{
find: /^@steipete\/summarize-core$/,
replacement: resolve(rootDir, 'packages/core/src/index.ts'),
},
],
},
test: {
environment: 'node',
include: ['tests/**/*.test.ts'],
setupFiles: ['tests/setup.ts'],
hookTimeout: 15_000,
testTimeout: 15_000,
coverage: {
provider: 'v8',
reporter: coverageReporters,
include: ['src/**/*.ts'],
exclude: [
'**/*.d.ts',
'**/dist/**',
'**/node_modules/**',
'tests/**',
// Daemon is integration-tested / manually tested; unit coverage is noisy + brittle.
'**/src/daemon/**',
// OS/browser integration (exec/sqlite/keychain); covered via higher-level tests.
'**/src/content/transcript/providers/twitter-cookies-*.ts',
// Barrels / type-only entrypoints (noise for coverage).
'src/**/index.ts',
'src/**/types.ts',
'src/**/deps.ts',
],
thresholds: {
branches: 75,
functions: 75,
lines: 75,
statements: 75,
},
},
},
})