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
+3 -5
View File
@@ -1,7 +1,7 @@
import { afterEach, beforeEach, describe, expect, test } from "bun:test"
import type { BackgroundManager } from "../features/background-agent"
import { setMainSession, subagentSessions } from "../features/claude-code-session-state"
import { setMainSession, subagentSessions, _resetForTesting } from "../features/claude-code-session-state"
import { createTodoContinuationEnforcer } from "./todo-continuation-enforcer"
describe("todo-continuation-enforcer", () => {
@@ -60,16 +60,14 @@ describe("todo-continuation-enforcer", () => {
}
beforeEach(() => {
_resetForTesting()
promptCalls = []
toastCalls = []
mockMessages = []
setMainSession(undefined)
subagentSessions.clear()
})
afterEach(() => {
setMainSession(undefined)
subagentSessions.clear()
_resetForTesting()
})
test("should inject continuation when idle with incomplete todos", async () => {