google-gemini/gemini-cli
Auf GitHub ansehentest(a2a-server): migrate process.env to vi.stubEnv() per GEMINI.md conventions
Open
#19.826 geöffnet am 21. Feb. 2026
Stalearea/platformgood first issuehelp wantedkind/bugkind/customer-issuepriority/p3status/bot-triaged
Repository-Metriken
- Stars
- (103.992 Stars)
- PR-Merge-Metriken
- (Durchschn. Merge 4T 2h) (55 gemergte PRs in 30 T)
Beschreibung
Description
Per the testing conventions documented in GEMINI.md:
When testing code that depends on environment variables, use
vi.stubEnv('NAME', 'value')inbeforeEachandvi.unstubAllEnvs()inafterEach. Avoid modifyingprocess.envdirectly as it can lead to test leakage and is less reliable.
Several test files in packages/a2a-server/ still use direct
process.env manipulation:
src/commands/init.test.ts(1 direct assignment)src/config/config.test.ts(~8 direct assignments/deletions)src/http/app.test.ts(3 direct assignments/deletions)
Proposed fix
Replace all direct process.env writes and deletes with
vi.stubEnv() / vi.unstubAllEnvs() following the pattern
documented in GEMINI.md.
I'd be happy to submit a PR for this.