elasticsearch.ts 569 B

1234567891011121314
  1. // Vitest injects VITE_- and VITE_-prefixed .env.test vars into process.env for Node environments.
  2. // Map VITE_-prefixed vars to the names that the app's configManager expects.
  3. const VITE_ENV_MAP: Record<string, string> = {
  4. VITE_ELASTICSEARCH_URI: 'ELASTICSEARCH_URI',
  5. VITE_ELASTICSEARCH_VERSION: 'ELASTICSEARCH_VERSION',
  6. VITE_ELASTICSEARCH_REINDEX_ON_BOOT: 'ELASTICSEARCH_REINDEX_ON_BOOT',
  7. };
  8. for (const [vitestKey, appKey] of Object.entries(VITE_ENV_MAP)) {
  9. const value = process.env[vitestKey];
  10. if (value != null) {
  11. process.env[appKey] = value;
  12. }
  13. }