Files
mcpctl/vitest.config.ts

31 lines
1.1 KiB
TypeScript
Raw Normal View History

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'],
// 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,
// 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',
],
// 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
},
});