Files
waggle-os/vitest.config.ts
shumeiko.it 46687a823a chore: remove the packages excluded from the community edition (P2.2)
Delete apps/www, packages/admin-web, every packages/hive-mind-* package,
packages/memory-mcp and packages/wiki-compiler (ADR-0002), with what
existed only for them: their tests kept outside the packages, the hook
runtime build, the hive-mind OSS subtree-split and drift scripts, the
www deploy and hive-mind-cli workflows, the staged hook lifecycle step
in the Windows desktop workflows, and the root dev:www, build:www and
build:hook-runtime scripts.

Drop the matching excludes from the Vitest, ESLint and workspace
dependency checks, the next override, and the extraneous workspace
entries from package-lock.json. The smart-router qualification seed
now writes its spend to waggle.db, where the sidecar has read cost
traces since P1.5.
2026-11-01 00:21:10 +01:00

63 lines
2.3 KiB
TypeScript

import { defineConfig } from 'vitest/config';
import path from 'node:path';
import { INFRA_TEST_SUITES } from './vitest.infra-suites';
import { WAGGLE_SOURCE_CONDITIONS, waggleSrcAliases } from './vitest.aliases';
export default defineConfig({
resolve: {
// Workspace packages resolve to src/ through their `source` export, so
// tests need no build step (P2.1).
conditions: WAGGLE_SOURCE_CONDITIONS,
alias: {
// Packages without a `source` export (the postponed team ones) map to src/.
...waggleSrcAliases(__dirname),
// App uses @/ alias for src directory
'@/': path.resolve(__dirname, 'app/src') + '/',
'@': path.resolve(__dirname, 'app/src'),
},
},
ssr: {
resolve: { conditions: WAGGLE_SOURCE_CONDITIONS },
},
test: {
globals: true,
// Passing tests should not bury failures under expected provider/startup
// diagnostics. Use `--silent=false` when investigating a failing case.
silent: true,
testTimeout: 30_000,
setupFiles: ['./vitest.setup.ts'],
pool: 'forks',
maxWorkers: 4,
include: [
'packages/*/tests/**/*.test.ts',
'packages/*/tests/**/*.test.tsx',
'packages/*/src/**/*.test.ts',
'tests/**/*.test.ts',
'scripts/**/*.test.ts',
'app/scripts/**/*.test.ts',
'app/tests/**/*.test.ts',
],
// INFRA_TEST_SUITES require live Postgres (5434) + Redis (6381); excluded
// from the default gate so `npm test` runs green without Docker. Run them
// via `npm run test:infra`.
exclude: [
'apps/**', 'node_modules/**', '**/__faza1-closed/**',
// The postponed team runtime (ADR-0003) is neither built nor tested.
'packages/team-server/**', 'packages/waggle-dance/**', 'packages/worker/**',
...INFRA_TEST_SUITES,
// Copies the ~13MB pre-built packages/marketplace/marketplace.db fixture
// (createTempDb). Proper fix: regenerate it from sources-seed.ts in test
// setup (P1.6).
'packages/marketplace/tests/sync-verification.test.ts',
// Wall-clock budgets run in a dedicated lane so filesystem/process
// contention cannot make the deterministic correctness gate flaky.
'packages/server/tests/performance/**',
],
coverage: {
provider: 'v8',
include: ['packages/*/src/**/*.ts'],
exclude: ['packages/*/src/**/*.d.ts'],
},
},
});