mirror of
https://github.com/google-gemini/gemini-cli
synced 2026-04-21 13:37:17 +00:00
Merge f3de304556 into a38e2f0048
This commit is contained in:
commit
78b7c25c91
2 changed files with 7 additions and 1 deletions
|
|
@ -1390,6 +1390,7 @@ describe('ShellExecutionService child_process fallback', () => {
|
|||
cp.stdout?.emit('data', Buffer.from(chunk2));
|
||||
cp.stdout?.emit('data', Buffer.from(chunk3));
|
||||
cp.emit('exit', 0, null);
|
||||
cp.emit('close', 0, null);
|
||||
});
|
||||
|
||||
const truncationMessage =
|
||||
|
|
@ -1577,6 +1578,7 @@ describe('ShellExecutionService child_process fallback', () => {
|
|||
cp.stdout?.emit('data', binaryChunk1);
|
||||
cp.stdout?.emit('data', binaryChunk2);
|
||||
cp.emit('exit', 0, null);
|
||||
cp.emit('close', 0, null);
|
||||
});
|
||||
|
||||
expect(onOutputEventMock).toHaveBeenCalledTimes(4);
|
||||
|
|
@ -1641,6 +1643,7 @@ describe('ShellExecutionService child_process fallback', () => {
|
|||
mockPlatform.mockReturnValue('win32');
|
||||
await simulateExecution('dir "foo bar"', (cp) => {
|
||||
cp.emit('exit', 0, null);
|
||||
cp.emit('close', 0, null);
|
||||
});
|
||||
|
||||
expect(mockCpSpawn).toHaveBeenCalledWith(
|
||||
|
|
@ -1658,6 +1661,7 @@ describe('ShellExecutionService child_process fallback', () => {
|
|||
mockPlatform.mockReturnValue('linux');
|
||||
await simulateExecution('ls "foo bar"', (cp) => {
|
||||
cp.emit('exit', 0, null);
|
||||
cp.emit('close', 0, null);
|
||||
});
|
||||
|
||||
expect(mockCpSpawn).toHaveBeenCalledWith(
|
||||
|
|
@ -1772,6 +1776,7 @@ describe('ShellExecutionService execution method selection', () => {
|
|||
|
||||
// Simulate exit to allow promise to resolve
|
||||
mockChildProcess.emit('exit', 0, null);
|
||||
mockChildProcess.emit('close', 0, null);
|
||||
const result = await handle.result;
|
||||
|
||||
expect(mockGetPty).not.toHaveBeenCalled();
|
||||
|
|
@ -1795,6 +1800,7 @@ describe('ShellExecutionService execution method selection', () => {
|
|||
|
||||
// Simulate exit to allow promise to resolve
|
||||
mockChildProcess.emit('exit', 0, null);
|
||||
mockChildProcess.emit('close', 0, null);
|
||||
const result = await handle.result;
|
||||
|
||||
expect(mockGetPty).toHaveBeenCalled();
|
||||
|
|
|
|||
|
|
@ -772,7 +772,7 @@ export class ShellExecutionService {
|
|||
|
||||
abortSignal.addEventListener('abort', abortHandler, { once: true });
|
||||
|
||||
child.on('exit', (code, signal) => {
|
||||
child.on('close', (code, signal) => {
|
||||
handleExit(code, signal);
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue