LibreChat/e2e/setup/runtimeEnv.ts
Danny Avila b993d9fb28
🛟 test: Restore Playwright Smoke E2E (#13020)
* test: restore Playwright smoke e2e

* test: harden e2e smoke setup

* test: sync e2e server bindings

* test: normalize e2e auth urls
2026-05-14 09:49:26 -04:00

21 lines
458 B
TypeScript

import fs from 'fs';
import { getRuntimeEnvPath } from './env';
export function applyRuntimeEnv() {
const runtimeEnvPath = getRuntimeEnvPath();
if (!fs.existsSync(runtimeEnvPath)) {
return;
}
const runtimeEnv = JSON.parse(fs.readFileSync(runtimeEnvPath, 'utf8')) as Record<
string,
string | undefined
>;
for (const [key, value] of Object.entries(runtimeEnv)) {
if (value != null) {
process.env[key] = value;
}
}
}