test(hooks): restore module mock cleanup

This commit is contained in:
YeonGyu-Kim
2026-05-30 15:35:40 +09:00
parent fa3e3de9e6
commit 08f4a4ac50
8 changed files with 38 additions and 9 deletions
@@ -1,5 +1,5 @@
/// <reference types="bun-types" />
import { afterEach, beforeEach, describe, expect, mock, test } from "bun:test"
import { afterAll, afterEach, beforeEach, describe, expect, mock, test } from "bun:test"
import type { AutoCompactState } from "./types"
@@ -38,6 +38,10 @@ mock.module("../../features/hook-message-injector", () => ({
import { _resetForTesting as resetSessionState, updateSessionAgent } from "../../features/claude-code-session-state/state"
import { runAggressiveTruncationStrategy } from "./aggressive-truncation-strategy"
afterAll(() => {
mock.restore()
})
type FakeClient = {
session: {
promptAsync: (input: PromptAsyncCall) => Promise<unknown>