diff --git a/test/test-env.ts b/test/test-env.ts index fd790b927717..0302c4de8513 100644 --- a/test/test-env.ts +++ b/test/test-env.ts @@ -355,7 +355,8 @@ export function installTestEnv(options?: { loadProfileEnv?: boolean }): { const realHome = process.env.HOME ?? os.homedir(); const liveEnvSnapshot = { ...process.env }; - if (options?.loadProfileEnv ?? live) { + const shouldLoadProfileEnv = options?.loadProfileEnv ?? (live || allowRealHome); + if (shouldLoadProfileEnv) { loadProfileEnv(realHome); }