Files
oh-my-opencode/test-setup.ts
T
YeonGyu-Kim 33c8b7f675 fix(tests): resolve 6 test isolation failures in full suite
3 failures in fallback.cliproxyapi-matrix.test.ts:
- Root cause: leaked spyOn(getMainSessionID) in
  tool-execute-before-session-notification.test.ts was never restored,
  poisoning module state for subsequent tests in the same worker
- Added mockRestore() call and _resetModelFallbackForTesting in afterEach

3 failures in background-agent/manager.test.ts:
- Root cause: connected-providers-cache memConnected/memProviderModels
  persisted across test files, making isReachable() skip fallback
  candidates in retry tests
- Added mock.module for connected-providers-cache at file level
- Added _resetMemCacheForTesting export and global beforeEach cleanup

Full suite: 4638/4638 pass, 0 fail
2026-04-01 04:30:34 +09:00

11 lines
467 B
TypeScript

import { beforeEach } from "bun:test"
import { _resetForTesting as resetClaudeSessionState } from "./src/features/claude-code-session-state/state"
import { _resetForTesting as resetModelFallbackState } from "./src/hooks/model-fallback/hook"
import { _resetMemCacheForTesting as resetConnectedProvidersCache } from "./src/shared/connected-providers-cache"
beforeEach(() => {
resetClaudeSessionState()
resetModelFallbackState()
resetConnectedProvidersCache()
})