learning_ai_common_plat/services/platform-service/vitest.config.ts
saravanakumardb1 2c6397272f fix(test): add env defaults to platform-service vitest config
Aligns service-local vitest.config.ts with root config so tests pass
both via 'pnpm test' (uses service config) and 'npx vitest run' (uses root).
Fixes telemetry.test.ts which fails because its import chain eagerly
loads config.ts → envSchema.parse() requiring COSMOS_ENDPOINT/KEY/JWT_SECRET.

Added: RATE_LIMIT_STORE_MODE=memory, COSMOS_ENDPOINT, COSMOS_KEY, JWT_SECRET
(all test-safe placeholders, never used at runtime with DB_PROVIDER=memory)
2026-03-21 15:32:14 -07:00

18 lines
452 B
TypeScript

import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
globals: true,
environment: 'node',
include: ['src/**/*.test.ts'],
pool: 'threads',
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',
},
},
});