Skip to content

chore: migrate integration test helpers from process.env to vi.stubEnv#133

Merged
enko merged 1 commit intomainfrom
claude/fix-stubenv-issue-9ISQG
Mar 15, 2026
Merged

chore: migrate integration test helpers from process.env to vi.stubEnv#133
enko merged 1 commit intomainfrom
claude/fix-stubenv-issue-9ISQG

Conversation

@enko
Copy link
Copy Markdown
Member

@enko enko commented Mar 15, 2026

Replace fragile process.env assignments and delete statements with
Vitest's vi.stubEnv() and vi.unstubAllEnvs() API across all four
integration test helper files. This ensures env variables are restored
atomically even if tests crash before afterAll runs, and brings all
helpers into consistency with health.test.ts (reference implementation).

Files migrated:

  • auth.helpers.ts
  • friends.helpers.ts
  • search.helpers.ts
  • postgis.helpers.ts

https://claude.ai/code/session_01SxmmhKAEjzLfZJv8GaFmCs

Replace fragile process.env assignments and delete statements with
Vitest's vi.stubEnv() and vi.unstubAllEnvs() API across all four
integration test helper files. This ensures env variables are restored
atomically even if tests crash before afterAll runs, and brings all
helpers into consistency with health.test.ts (reference implementation).

Files migrated:
- auth.helpers.ts
- friends.helpers.ts
- search.helpers.ts
- postgis.helpers.ts

https://claude.ai/code/session_01SxmmhKAEjzLfZJv8GaFmCs
@github-actions
Copy link
Copy Markdown

🔍 Automated Code Review

Commit `df02038`
Reviewed 2026-03-15T00:00:00Z
Status ✅ Approved

Findings

No issues found.

AGENTS.md Compliance

  • ✅ Security requirements
  • ✅ Architecture patterns
  • ✅ Testing standards

Summary

Clean, focused refactoring that correctly migrates all four integration test helpers from manual process.env mutation and delete to Vitest's vi.stubEnv() / vi.unstubAllEnvs() API. This ensures atomic env cleanup even when tests crash before afterAll runs, and brings all helpers into consistency with the health.test.ts reference implementation. No logic changes — purely a test infrastructure improvement.


🤖 Automated review by Claude Code • View CI Run

@enko enko merged commit a7c9446 into main Mar 15, 2026
5 checks passed
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 2.67.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants