fix(test): add _resetForTesting to all session state tests

This commit is contained in:
justsisyphus
2026-01-17 17:04:40 +09:00
parent b4fa31a47a
commit fa9bf4590c
5 changed files with 44 additions and 50 deletions
+2 -1
View File
@@ -1,6 +1,6 @@
import { describe, expect, test, beforeEach, afterEach, spyOn } from "bun:test"
import { createKeywordDetectorHook } from "./index"
import { setMainSession, updateSessionAgent, clearSessionAgent } from "../../features/claude-code-session-state"
import { setMainSession, updateSessionAgent, clearSessionAgent, _resetForTesting } from "../../features/claude-code-session-state"
import { ContextCollector } from "../../features/context-injector"
import * as sharedModule from "../../shared"
import * as sessionState from "../../features/claude-code-session-state"
@@ -11,6 +11,7 @@ describe("keyword-detector registers to ContextCollector", () => {
let getMainSessionSpy: ReturnType<typeof spyOn>
beforeEach(() => {
_resetForTesting()
logCalls = []
logSpy = spyOn(sharedModule, "log").mockImplementation((msg: string, data?: unknown) => {
logCalls.push({ msg, data })