- Pass subprocess test options only when defined in `terminalManager` tests - Narrow web store terminal event fixtures to `started`/`activity` event shapes
Unified · Split
| @@ -151,8 +151,10 @@ describe("TerminalManager", () => { · 150 unmodified lines | ||
| 151 | 151 | ptyAdapter, |
| 152 | 152 | historyLineLimit, |
| 153 | 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 | + : {}), | |
| 156 | 158 | }); |
| 157 | 159 | return { logsDir, ptyAdapter, manager }; |
| 158 | 160 | } |
| @@ -5,6 +5,9 @@ import { type AppState, reducer } from "./store"; · 4 unmodified lines | ||
| 5 | 5 | import { DEFAULT_THREAD_TERMINAL_HEIGHT, DEFAULT_THREAD_TERMINAL_ID } from "./types"; |
| 6 | 6 | import type { Thread } from "./types"; |
| 7 | 7 | |
| 8 | +type TerminalStartedEvent = Extract<TerminalEvent, { type: "started" }>; | |
| 9 | +type TerminalActivityEvent = Extract<TerminalEvent, { type: "activity" }>; | |
| 10 | + | |
| 8 | 11 | function makeSession(overrides: Partial<ProviderSession> = {}): ProviderSession { |
| 9 | 12 | return { |
| 10 | 13 | sessionId: "sess-1", |
| @@ -76,7 +79,9 @@ function makeState(thread: Thread): AppState { · 65 unmodified lines | ||
| 76 | 79 | }; |
| 77 | 80 | } |
| 78 | 81 | |
| 79 | −function makeTerminalStartedEvent(overrides: Partial<TerminalEvent> = {}): TerminalEvent { | |
| 82 | +function makeTerminalStartedEvent( | |
| 83 | + overrides: Partial<TerminalStartedEvent> = {}, | |
| 84 | +): TerminalStartedEvent { | |
| 80 | 85 | return { |
| 81 | 86 | type: "started", |
| 82 | 87 | threadId: "thread-local-1", |
| @@ -97,7 +102,9 @@ function makeTerminalStartedEvent(overrides: Partial<TerminalEvent> = {}): Termi · 14 unmodified lines | ||
| 97 | 102 | }; |
| 98 | 103 | } |
| 99 | 104 | |
| 100 | −function makeTerminalActivityEvent(overrides: Partial<TerminalEvent> = {}): TerminalEvent { | |
| 105 | +function makeTerminalActivityEvent( | |
| 106 | + overrides: Partial<TerminalActivityEvent> = {}, | |
| 107 | +): TerminalActivityEvent { | |
| 101 | 108 | return { |
| 102 | 109 | type: "activity", |
| 103 | 110 | threadId: "thread-local-1", |