2026-02-21 03:10:39 +00:00
|
|
|
import { defineConfig } from 'vitest/config';
|
|
|
|
|
|
|
|
|
|
export default defineConfig({
|
|
|
|
|
test: {
|
|
|
|
|
globals: true,
|
|
|
|
|
coverage: {
|
|
|
|
|
provider: 'v8',
|
|
|
|
|
reporter: ['text', 'json', 'html'],
|
|
|
|
|
exclude: ['**/node_modules/**', '**/dist/**', '**/*.config.*'],
|
|
|
|
|
},
|
|
|
|
|
include: ['src/*/tests/**/*.test.ts', 'tests/**/*.test.ts'],
|
2026-04-26 21:31:27 +01:00
|
|
|
// src/web tests need jsdom; they're run via the web package's own
|
|
|
|
|
// vitest.config.ts under the projects entry below.
|
|
|
|
|
exclude: ['**/node_modules/**', '**/smoke/**', 'src/db/tests/**', 'src/web/tests/**'],
|
2026-02-21 03:10:39 +00:00
|
|
|
testTimeout: 10000,
|
2026-04-26 21:31:27 +01:00
|
|
|
// Vitest 4 uses `projects` (in-config) instead of vitest.workspace.ts.
|
|
|
|
|
// Each project below is rooted in a workspace package; vitest reads
|
|
|
|
|
// its `vitest.config.ts` (or vite.config.ts) for the test config.
|
|
|
|
|
projects: [
|
|
|
|
|
'src/shared',
|
|
|
|
|
'src/cli',
|
|
|
|
|
'src/mcpd',
|
|
|
|
|
'src/mcplocal',
|
|
|
|
|
'src/web',
|
|
|
|
|
],
|
2026-03-07 00:39:25 +00:00
|
|
|
// DB tests require a test database; run them explicitly via:
|
|
|
|
|
// pnpm --filter db exec vitest run
|
|
|
|
|
// globalSetup: ['src/db/tests/global-setup.ts'],
|
2026-02-21 03:10:39 +00:00
|
|
|
},
|
|
|
|
|
});
|