fix: resolve test isolation failures in task-continuation-enforcer and config-handler tests
- Change BackgroundManager import to type-only to prevent global process listener pollution across parallel test files - Replace real BackgroundManager construction with createMockBackgroundManager - Fix nested spyOn in config-handler tests to reuse beforeEach spy via mockResolvedValue instead of re-spying inside test bodies
This commit is contained in:
@@ -4,7 +4,7 @@ import { mkdtempSync, rmSync, writeFileSync } from "node:fs"
|
||||
import { tmpdir } from "node:os"
|
||||
import { join } from "node:path"
|
||||
|
||||
import { BackgroundManager } from "../features/background-agent"
|
||||
import type { BackgroundManager } from "../features/background-agent"
|
||||
import { setMainSession, subagentSessions, _resetForTesting } from "../features/claude-code-session-state"
|
||||
import type { OhMyOpenCodeConfig } from "../config/schema"
|
||||
import { TaskObjectSchema } from "../tools/task/types"
|
||||
@@ -244,7 +244,7 @@ describe("task-continuation-enforcer", () => {
|
||||
})
|
||||
|
||||
const hook = createTaskContinuationEnforcer(createMockPluginInput(), createConfig(taskDir), {
|
||||
backgroundManager: new BackgroundManager(createMockPluginInput()),
|
||||
backgroundManager: createMockBackgroundManager(false),
|
||||
})
|
||||
|
||||
// when - session goes idle
|
||||
|
||||
Reference in New Issue
Block a user