-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.workspace.ts
More file actions
47 lines (45 loc) · 1.55 KB
/
Copy pathvitest.workspace.ts
File metadata and controls
47 lines (45 loc) · 1.55 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
import { defineWorkspace } from 'vitest/config';
import { fileURLToPath, URL } from 'node:url';
// The @citadel_cli/* packages now publish built artifacts (their package.json main
// points at dist/), so the node test projects alias the bare specifiers back to
// source — tests run against the live source without a build step. The React
// project resolves @citadel_cli/core via its own vite.config alias.
const coreSrc = fileURLToPath(new URL('./packages/core/src/index.ts', import.meta.url));
const sampleSrc = fileURLToPath(new URL('./packages/sample-commands/src/index.ts', import.meta.url));
// Three test projects: the React library (jsdom, configured in
// packages/react/vite.config.ts) and the framework-agnostic @citadel_cli/core
// engine + @citadel_cli/cli adapter (plain node — no DOM). See
// CORE_EXTRACTION_DESIGN.md.
export default defineWorkspace([
'./packages/react/vite.config.ts',
{
resolve: {
alias: {
'@citadel_cli/core': coreSrc,
'@citadel_cli/sample-commands': sampleSrc,
},
},
test: {
name: 'core',
root: './packages/core',
environment: 'node',
include: ['src/**/*.test.ts'],
},
},
{
// The CLI's Ink TUI tests are .tsx — use the automatic JSX runtime.
esbuild: { jsx: 'automatic' },
resolve: {
alias: {
'@citadel_cli/core': coreSrc,
'@citadel_cli/sample-commands': sampleSrc,
},
},
test: {
name: 'cli',
root: './packages/cli',
environment: 'node',
include: ['src/**/*.test.{ts,tsx}'],
},
},
]);