authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-02-12 22:14:08-08:00
committergravatar for jmarminge@gmail.comJulius Marminge <jmarminge@gmail.com> 2026-02-12 22:20:01-08:00
log804572c8ff6c19a4e0355ff673b4e76cfe2069a2
tree37cf772264a2e12051227da9146a8af4a1ab0ecc
parentddc4a93c36e0cdd263d91d01e11e900c8d9ee0ef

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

2 files changed, 13 insertions(+), 4 deletions(-)

apps/server/src/terminalManager.test.ts+4-2
...@@ -151,8 +151,10 @@ describe("TerminalManager", () => {...@@ -151,8 +151,10 @@ describe("TerminalManager", () => {
151 ptyAdapter,151 ptyAdapter,
152 historyLineLimit,152 historyLineLimit,
153 shellResolver: options.shellResolver ?? (() => "/bin/bash"),153 shellResolver: options.shellResolver ?? (() => "/bin/bash"),
154 subprocessChecker: options.subprocessChecker,154 ...(options.subprocessChecker ? { subprocessChecker: options.subprocessChecker } : {}),
155 subprocessPollIntervalMs: options.subprocessPollIntervalMs,155 ...(options.subprocessPollIntervalMs
156 ? { subprocessPollIntervalMs: options.subprocessPollIntervalMs }
157 : {}),
156 });158 });
157 return { logsDir, ptyAdapter, manager };159 return { logsDir, ptyAdapter, manager };
158 }160 }
apps/web/src/store.test.ts+9-2
...@@ -5,6 +5,9 @@ import { type AppState, reducer } from "./store";...@@ -5,6 +5,9 @@ import { type AppState, reducer } from "./store";
5import { DEFAULT_THREAD_TERMINAL_HEIGHT, DEFAULT_THREAD_TERMINAL_ID } from "./types";5import { DEFAULT_THREAD_TERMINAL_HEIGHT, DEFAULT_THREAD_TERMINAL_ID } from "./types";
6import type { Thread } from "./types";6import type { Thread } from "./types";
77
8type TerminalStartedEvent = Extract<TerminalEvent, { type: "started" }>;
9type TerminalActivityEvent = Extract<TerminalEvent, { type: "activity" }>;
10
8function makeSession(overrides: Partial<ProviderSession> = {}): ProviderSession {11function makeSession(overrides: Partial<ProviderSession> = {}): ProviderSession {
9 return {12 return {
10 sessionId: "sess-1",13 sessionId: "sess-1",
...@@ -76,7 +79,9 @@ function makeState(thread: Thread): AppState {...@@ -76,7 +79,9 @@ function makeState(thread: Thread): AppState {
76 };79 };
77}80}
7881
79function makeTerminalStartedEvent(overrides: Partial<TerminalEvent> = {}): TerminalEvent {82function makeTerminalStartedEvent(
83 overrides: Partial<TerminalStartedEvent> = {},
84): TerminalStartedEvent {
80 return {85 return {
81 type: "started",86 type: "started",
82 threadId: "thread-local-1",87 threadId: "thread-local-1",
...@@ -97,7 +102,9 @@ function makeTerminalStartedEvent(overrides: Partial<TerminalEvent> = {}): Termi...@@ -97,7 +102,9 @@ function makeTerminalStartedEvent(overrides: Partial<TerminalEvent> = {}): Termi
97 };102 };
98}103}
99104
100function makeTerminalActivityEvent(overrides: Partial<TerminalEvent> = {}): TerminalEvent {105function makeTerminalActivityEvent(
106 overrides: Partial<TerminalActivityEvent> = {},
107): TerminalActivityEvent {
101 return {108 return {
102 type: "activity",109 type: "activity",
103 threadId: "thread-local-1",110 threadId: "thread-local-1",