mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 10:58:56 +00:00
## Summary - Clone `bunEnv` and delete `AGENTS` property in `beforeAll` - Replace all `bunEnv` references with `testEnv` in test spawns - Prevents parent process's `AGENTS` env var from leaking into tests ## Problem The `claudecode-flag` test was using `bunEnv` directly, which includes `...process.env`. When running in environments like Claude Code where `AGENTS` may be set, this variable would leak into the test child processes and potentially affect test behavior. ## Solution Created a `testEnv` clone in `beforeAll` that explicitly deletes `AGENTS`, ensuring consistent test behavior regardless of the parent process's environment. ## Test plan - [x] Test passes without `AGENTS` set - [x] Test passes with `AGENTS=1` set in parent environment 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Bot <claude-bot@bun.sh> Co-authored-by: Claude <noreply@anthropic.com>