diff --git a/apps/hub/src/artifacts-mount.test.ts b/apps/hub/src/artifacts-mount.test.ts index 6237d0f73..27c93abfc 100644 --- a/apps/hub/src/artifacts-mount.test.ts +++ b/apps/hub/src/artifacts-mount.test.ts @@ -24,7 +24,9 @@ type EnvKey = (typeof KEYS)[number]; const saved: Partial> = {}; function clearEnvKey(key: EnvKey): void { - process.env[key] = undefined; + // Assigning `undefined` would store the string "undefined"; the key has to + // go. `Reflect.deleteProperty` because eslint forbids dynamic `delete`. + Reflect.deleteProperty(process.env, key); } function stashEnv(): void { diff --git a/apps/hub/src/memory-mount.test.ts b/apps/hub/src/memory-mount.test.ts index 4f061c0d6..8c33708e2 100644 --- a/apps/hub/src/memory-mount.test.ts +++ b/apps/hub/src/memory-mount.test.ts @@ -17,8 +17,12 @@ type EnvKey = (typeof KEYS)[number]; const saved: Partial> = {}; function clearEnvKey(key: EnvKey): void { - // Prefer assignment over `delete process.env[key]` — eslint forbids dynamic delete. - process.env[key] = undefined; + // Must actually remove the key: `process.env[key] = undefined` stores the + // *string* "undefined" (Bun >= 1.4 matches Node here), which reads as a + // configured value and makes every DATABASE_URL/EMBED_BASE_URL gate in this + // app's suites fire against postgres.js's localhost:5432 default. + // `Reflect.deleteProperty` because eslint forbids dynamic `delete`. + Reflect.deleteProperty(process.env, key); } afterEach(() => { diff --git a/apps/hub/src/memory-workflow-routes.test.ts b/apps/hub/src/memory-workflow-routes.test.ts index b4d38b6a1..6fbf75d08 100644 --- a/apps/hub/src/memory-workflow-routes.test.ts +++ b/apps/hub/src/memory-workflow-routes.test.ts @@ -43,7 +43,9 @@ type EnvKey = (typeof KEYS)[number]; const saved: Partial> = {}; function clearEnvKey(key: EnvKey): void { - process.env[key] = undefined; + // Assigning `undefined` would store the string "undefined"; the key has to + // go. `Reflect.deleteProperty` because eslint forbids dynamic `delete`. + Reflect.deleteProperty(process.env, key); } function stashEnv(): void {