Root vitest.config.ts now sets: - DB_PROVIDER=memory — datastore uses MemoryDatastoreProvider (no Cosmos needed) - RATE_LIMIT_STORE_MODE=memory — ratelimit store uses in-memory sliding window - COSMOS_ENDPOINT, COSMOS_KEY, JWT_SECRET — test-safe placeholders so config.ts Zod parse succeeds (never used at runtime with DB_PROVIDER=memory) This fixes 35 pre-existing test failures across 6 files when running from root: - ratelimit.test.ts (15 tests) — was hitting Cosmos path - diagnostics.test.ts (4 tests) — was hitting Cosmos path - auto-register.test.ts (8 tests) — config parse failed - onboarding.test.ts (1 test) — config parse failed - telemetry.test.ts (suite) — config parse failed via event-bus import chain - cross-product.test.ts (6 tests) — config parse failed Platform-service: 117/117 files, 1389/1389 tests (was 1251 passing)
37 lines
831 B
TypeScript
37 lines
831 B
TypeScript
import { defineConfig } from 'vitest/config';
|
|
|
|
export default defineConfig({
|
|
test: {
|
|
globals: true,
|
|
environment: 'node',
|
|
passWithNoTests: true,
|
|
env: {
|
|
DB_PROVIDER: 'memory',
|
|
RATE_LIMIT_STORE_MODE: 'memory',
|
|
COSMOS_ENDPOINT: 'https://test.documents.azure.com:443/',
|
|
COSMOS_KEY: 'dGVzdC1rZXktZm9yLXZpdGVzdC1vbmx5',
|
|
JWT_SECRET: 'vitest-only-not-for-production',
|
|
},
|
|
coverage: {
|
|
provider: 'v8',
|
|
reporter: ['text', 'json', 'html'],
|
|
exclude: [
|
|
'node_modules/**',
|
|
'dist/**',
|
|
'coverage/**',
|
|
'**/*.test.ts',
|
|
'**/*.config.*',
|
|
'**/index.ts',
|
|
],
|
|
thresholds: {
|
|
global: {
|
|
branches: 80,
|
|
functions: 80,
|
|
lines: 80,
|
|
statements: 80,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
});
|