-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathvitest.workspace.ts
More file actions
53 lines (51 loc) · 1.53 KB
/
vitest.workspace.ts
File metadata and controls
53 lines (51 loc) · 1.53 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
import { defineWorkspace } from 'vitest/config';
import path from 'path';
import { fileURLToPath } from 'url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
export default defineWorkspace([
{
extends: './vitest.config.mts',
test: {
name: 'unit',
include: [
'packages/core/src/**/*.test.ts',
'packages/types/src/**/*.test.ts',
'packages/cli/src/**/*.test.ts',
'packages/data-objectstack/src/**/*.test.ts',
// Pure-logic tests across packages (auto-layout, i18n resolution, etc.)
// can run in node without component registry — huge speedup.
'packages/*/src/**/*.test.ts',
],
exclude: [
'**/node_modules/**',
'**/dist/**',
// Everything in apps/* has DOM dependencies; route via the ui project.
'apps/**',
],
environment: 'node',
// Minimal setup: polyfills only, no heavy component registry.
setupFiles: [path.resolve(__dirname, 'vitest.setup.base.ts')],
testTimeout: 5000,
},
},
{
extends: './vitest.config.mts',
test: {
name: 'ui',
include: [
'packages/*/src/**/*.test.tsx',
'apps/*/src/**/*.test.{ts,tsx}',
'examples/*/src/**/*.test.{ts,tsx}',
],
exclude: [
'**/node_modules/**',
'**/dist/**',
'**/cypress/**',
'**/e2e/**',
'**/.{idea,git,cache,output,temp}/**',
],
setupFiles: [path.resolve(__dirname, 'vitest.setup.dom.tsx')],
},
},
]);