mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-27 05:24:34 -07:00
Adding session id as part of json o/p (#14504)
This commit is contained in:
@@ -637,7 +637,11 @@ describe('runNonInteractive', () => {
|
||||
);
|
||||
expect(processStdoutSpy).toHaveBeenCalledWith(
|
||||
JSON.stringify(
|
||||
{ response: 'Hello World', stats: MOCK_SESSION_METRICS },
|
||||
{
|
||||
session_id: 'test-session-id',
|
||||
response: 'Hello World',
|
||||
stats: MOCK_SESSION_METRICS,
|
||||
},
|
||||
null,
|
||||
2,
|
||||
),
|
||||
@@ -720,7 +724,15 @@ describe('runNonInteractive', () => {
|
||||
|
||||
// This should output JSON with empty response but include stats
|
||||
expect(processStdoutSpy).toHaveBeenCalledWith(
|
||||
JSON.stringify({ response: '', stats: MOCK_SESSION_METRICS }, null, 2),
|
||||
JSON.stringify(
|
||||
{
|
||||
session_id: 'test-session-id',
|
||||
response: '',
|
||||
stats: MOCK_SESSION_METRICS,
|
||||
},
|
||||
null,
|
||||
2,
|
||||
),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -755,7 +767,15 @@ describe('runNonInteractive', () => {
|
||||
|
||||
// This should output JSON with empty response but include stats
|
||||
expect(processStdoutSpy).toHaveBeenCalledWith(
|
||||
JSON.stringify({ response: '', stats: MOCK_SESSION_METRICS }, null, 2),
|
||||
JSON.stringify(
|
||||
{
|
||||
session_id: 'test-session-id',
|
||||
response: '',
|
||||
stats: MOCK_SESSION_METRICS,
|
||||
},
|
||||
null,
|
||||
2,
|
||||
),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -792,6 +812,7 @@ describe('runNonInteractive', () => {
|
||||
expect(consoleErrorJsonSpy).toHaveBeenCalledWith(
|
||||
JSON.stringify(
|
||||
{
|
||||
session_id: 'test-session-id',
|
||||
error: {
|
||||
type: 'Error',
|
||||
message: 'Invalid input provided',
|
||||
@@ -837,6 +858,7 @@ describe('runNonInteractive', () => {
|
||||
expect(consoleErrorJsonSpy).toHaveBeenCalledWith(
|
||||
JSON.stringify(
|
||||
{
|
||||
session_id: 'test-session-id',
|
||||
error: {
|
||||
type: 'FatalInputError',
|
||||
message: 'Invalid command syntax provided',
|
||||
|
||||
Reference in New Issue
Block a user