GPT-5 finding
Tests mock process.stdout/stderr.write and process.exit without restoring, risking cross-test interference
mediummaintainabilityhigh
- src/commands/list/pods.test.ts
Global spies on stdout/stderr.write and process.exit are not restored in afterEach. In a multi-file test suite, these mocks can leak into other tests and cause nondeterministic failures or swallow output unexpectedly. Vitest runs tests in a shared process by default unless isolated, so restoration is important.
Recommendation
Call vi.restoreAllMocks() in afterEach or individually restore each spy via mockRestore. Also consider using vi.useFakeTimers/vi.resetAllMocks as appropriate to keep tests isolated.