-
-
Notifications
You must be signed in to change notification settings - Fork 594
Expand file tree
/
Copy pathvitest.config.ts
More file actions
81 lines (76 loc) · 2.1 KB
/
Copy pathvitest.config.ts
File metadata and controls
81 lines (76 loc) · 2.1 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
import { defaultServerConditions } from 'vite'
import { defineConfig } from 'vitest/config'
// Resolve @companion-app/shared to its raw TypeScript sources (no separate `tsc` emit) via the
// `companion:source` export condition. The node-environment projects resolve dependencies through
// Vite's SSR resolver, and inline projects do NOT inherit the root config's `resolve`/`ssr`
// options, so this must be set on each project that imports the package.
//
// Setting conditions replaces the defaults, so we re-add `defaultServerConditions` — but drop
// `module`, which otherwise makes some externalised deps (e.g. @opentelemetry/api) resolve to a
// bundler-only ESM build with extensionless imports that Node cannot load.
const ssrSourceResolve = {
resolve: {
conditions: ['companion:source', ...defaultServerConditions.filter((c) => c !== 'module')],
},
}
export default defineConfig({
test: {
projects: [
'webui/vitest.config.ts',
{
test: {
name: 'shared-lib',
root: 'shared-lib',
exclude: [
'**/module-local-dev/**',
'**/bundled-modules/**',
'**/node_modules/**',
'**/dist/**',
'**/build/**',
'**/coverage/**',
'**/webui/**',
],
},
},
{
ssr: ssrSourceResolve,
test: {
name: 'companion',
root: 'companion',
setupFiles: ['./test/setup.ts'],
exclude: [
'**/module-local-dev/**',
'**/bundled-modules/**',
'**/node_modules/**',
'**/dist/**',
'**/build/**',
'**/coverage/**',
'**/webui/**',
],
},
},
{
ssr: ssrSourceResolve,
test: {
name: 'config-tool',
root: 'config-tool',
exclude: ['**/node_modules/**', '**/dist/**', '**/build/**', '**/coverage/**'],
},
},
],
// reporters: ['default', 'html'],
// coverage: {
// reporter: ['text', 'json', 'html'],
// include: ['companion/**', 'shared-lib/**'],
// exclude: [
// '**/module-local-dev/**',
// '**/bundled-modules/**',
// '**/node_modules/**',
// '**/dist/**',
// '**/build/**',
// '**/coverage/**',
// '**/webui/**',
// ],
// },
},
})