summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/hooks/shellCommandProcessor.test.ts
diff options
context:
space:
mode:
authorGal Zahavi <[email protected]>2025-08-19 16:03:51 -0700
committerGitHub <[email protected]>2025-08-19 23:03:51 +0000
commitf1575f6d8de2f4efa0805a2d11a4a421a1a8228f (patch)
tree8977235b9a42983de3e76189f25ff055e9d28a83 /packages/cli/src/ui/hooks/shellCommandProcessor.test.ts
parent0cc2a1e7ef904294fff982a4d75bf098b5b262f7 (diff)
feat(core): refactor shell execution to use node-pty (#6491)
Co-authored-by: Jacob Richman <[email protected]>
Diffstat (limited to 'packages/cli/src/ui/hooks/shellCommandProcessor.test.ts')
-rw-r--r--packages/cli/src/ui/hooks/shellCommandProcessor.test.ts12
1 files changed, 7 insertions, 5 deletions
diff --git a/packages/cli/src/ui/hooks/shellCommandProcessor.test.ts b/packages/cli/src/ui/hooks/shellCommandProcessor.test.ts
index d5270aba..9c13c8ec 100644
--- a/packages/cli/src/ui/hooks/shellCommandProcessor.test.ts
+++ b/packages/cli/src/ui/hooks/shellCommandProcessor.test.ts
@@ -65,7 +65,10 @@ describe('useShellCommandProcessor', () => {
setPendingHistoryItemMock = vi.fn();
onExecMock = vi.fn();
onDebugMessageMock = vi.fn();
- mockConfig = { getTargetDir: () => '/test/dir' } as Config;
+ mockConfig = {
+ getTargetDir: () => '/test/dir',
+ getShouldUseNodePtyShell: () => false,
+ } as Config;
mockGeminiClient = { addHistory: vi.fn() } as unknown as GeminiClient;
vi.mocked(os.platform).mockReturnValue('linux');
@@ -104,13 +107,12 @@ describe('useShellCommandProcessor', () => {
): ShellExecutionResult => ({
rawOutput: Buffer.from(overrides.output || ''),
output: 'Success',
- stdout: 'Success',
- stderr: '',
exitCode: 0,
signal: null,
error: null,
aborted: false,
pid: 12345,
+ executionMethod: 'child_process',
...overrides,
});
@@ -141,6 +143,7 @@ describe('useShellCommandProcessor', () => {
'/test/dir',
expect.any(Function),
expect.any(Object),
+ false,
);
expect(onExecMock).toHaveBeenCalledWith(expect.any(Promise));
});
@@ -223,7 +226,6 @@ describe('useShellCommandProcessor', () => {
act(() => {
mockShellOutputCallback({
type: 'data',
- stream: 'stdout',
chunk: 'hello',
});
});
@@ -238,7 +240,6 @@ describe('useShellCommandProcessor', () => {
act(() => {
mockShellOutputCallback({
type: 'data',
- stream: 'stdout',
chunk: ' world',
});
});
@@ -319,6 +320,7 @@ describe('useShellCommandProcessor', () => {
'/test/dir',
expect.any(Function),
expect.any(Object),
+ false,
);
});