mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-07 00:51:34 +00:00
core: prevent parallel test runs from contaminating environment variables
This commit is contained in:
parent
95bf01a757
commit
90f39bf672
1 changed files with 3 additions and 1 deletions
4
packages/opencode/src/env/index.ts
vendored
4
packages/opencode/src/env/index.ts
vendored
|
|
@ -2,7 +2,9 @@ import { Instance } from "../project/instance"
|
|||
|
||||
export namespace Env {
|
||||
const state = Instance.state(() => {
|
||||
return process.env as Record<string, string | undefined>
|
||||
// Create a shallow copy to isolate environment per instance
|
||||
// Prevents parallel tests from interfering with each other's env vars
|
||||
return { ...process.env } as Record<string, string | undefined>
|
||||
})
|
||||
|
||||
export function get(key: string) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue