import { defineConfig } from 'vitest/config'; /** * Cosmos-emulator integration test runner. * * Only includes files matching `**\/*.cosmos.test.ts`. These suites must NOT * run under the default vitest config because they need a live Azure Cosmos * endpoint (the official `mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator` * image in CI, or a local emulator instance). * * Required env at runtime: * COSMOS_ENDPOINT e.g. https://localhost:8081 * COSMOS_KEY the well-known dev key for the emulator * COSMOS_DATABASE defaults to "notelett_test" * NODE_TLS_REJECT_UNAUTHORIZED=0 (emulator uses a self-signed cert) * * Run via: `pnpm --filter @notelett/backend run test:cosmos` */ export default defineConfig({ test: { globals: true, include: ['src/**/*.cosmos.test.ts'], exclude: ['**/node_modules/**'], // Cosmos calls are slower than in-memory; give the suite headroom. testTimeout: 30_000, hookTimeout: 60_000, passWithNoTests: false, env: { ALLOW_ANONYMOUS_DEV: 'true', DB_PROVIDER: 'cosmos', }, }, });