The best way to control Claude Code, Codex and more from any computer or phone
Tighten test fixtures for terminal options and event typing
- Pass subprocess test options only when defined in `terminalManager` tests - Narrow web store terminal event fixtures to `started`/`activity` event shapes
Julius Marminge committed
Feb 12, 2026 at 22:14 UTC
804572c8ff6c19a4e0355ff673b4e76cfe2069a2
2 files changed
+13
-4
apps/server/src/terminalManager.test.ts
+4
-2
@@ -151,8 +151,10 @@ describe("TerminalManager", () => {
151
ptyAdapter,
152
historyLineLimit,
153
shellResolver: options.shellResolver ?? (() => "/bin/bash"),
154
- subprocessChecker: options.subprocessChecker,
155
- subprocessPollIntervalMs: options.subprocessPollIntervalMs,
154
+ ...(options.subprocessChecker ? { subprocessChecker: options.subprocessChecker } : {}),
155
+ ...(options.subprocessPollIntervalMs
156
+ ? { subprocessPollIntervalMs: options.subprocessPollIntervalMs }
157
+ : {}),
158
});
159
return { logsDir, ptyAdapter, manager };
160
}
apps/web/src/store.test.ts
+9
-2
@@ -5,6 +5,9 @@ import { type AppState, reducer } from "./store";
5
import { DEFAULT_THREAD_TERMINAL_HEIGHT, DEFAULT_THREAD_TERMINAL_ID } from "./types";
6
import type { Thread } from "./types";
7
8
+type TerminalStartedEvent = Extract<TerminalEvent, { type: "started" }>;
9
+type TerminalActivityEvent = Extract<TerminalEvent, { type: "activity" }>;
10
+
11
function makeSession(overrides: Partial<ProviderSession> = {}): ProviderSession {
12
return {
13
sessionId: "sess-1",
@@ -76,7 +79,9 @@ function makeState(thread: Thread): AppState {
79
};
80
}
81
79
-function makeTerminalStartedEvent(overrides: Partial<TerminalEvent> = {}): TerminalEvent {
82
+function makeTerminalStartedEvent(
83
+ overrides: Partial<TerminalStartedEvent> = {},
84
+): TerminalStartedEvent {
85
return {
86
type: "started",
87
threadId: "thread-local-1",
@@ -97,7 +102,9 @@ function makeTerminalStartedEvent(overrides: Partial<TerminalEvent> = {}): Termi
102
};
103
}
104
100
-function makeTerminalActivityEvent(overrides: Partial<TerminalEvent> = {}): TerminalEvent {
105
+function makeTerminalActivityEvent(
106
+ overrides: Partial<TerminalActivityEvent> = {},
107
+): TerminalActivityEvent {
108
return {
109
type: "activity",
110
threadId: "thread-local-1",