diff --git a/src/hooks/anthropic-context-window-limit-recovery/recovery-hook.test.ts b/src/hooks/anthropic-context-window-limit-recovery/recovery-hook.test.ts index a0d799a2..72dd3746 100644 --- a/src/hooks/anthropic-context-window-limit-recovery/recovery-hook.test.ts +++ b/src/hooks/anthropic-context-window-limit-recovery/recovery-hook.test.ts @@ -1,4 +1,4 @@ -import { afterAll, beforeEach, describe, expect, mock, test } from "bun:test" +import { afterAll, afterEach, beforeEach, describe, expect, mock, test } from "bun:test" import type { PluginInput } from "@opencode-ai/plugin" import * as originalExecutor from "./executor" import * as originalParser from "./parser" @@ -81,6 +81,10 @@ describe("createAnthropicContextWindowLimitRecoveryHook", () => { parseAnthropicTokenLimitErrorMock.mockClear() }) + afterEach(() => { + mock.restore() + }) + test("cancels pending timer when session.idle handles compaction first", async () => { //#given const { restore, getClearTimeoutCalls } = setupDelayedTimeoutMocks()