Update error codes when process exiting the gemini cli (#13728)

This commit is contained in:
Megha Bansal
2025-11-26 08:13:21 +05:30
committed by GitHub
parent d2a6cff4df
commit d97bbd5324
12 changed files with 307 additions and 192 deletions

View File

@@ -7,6 +7,7 @@
import { expect, describe, it, beforeEach, afterEach } from 'vitest';
import { TestRig } from './test-helper.js';
import { join } from 'node:path';
import { ExitCodes } from '@google/gemini-cli-core/src/index.js';
describe('JSON output', () => {
let rig: TestRig;
@@ -81,7 +82,7 @@ describe('JSON output', () => {
expect(payload.error).toBeDefined();
expect(payload.error.type).toBe('Error');
expect(payload.error.code).toBe(1);
expect(payload.error.code).toBe(ExitCodes.FATAL_AUTHENTICATION_ERROR);
expect(payload.error.message).toContain(
"enforced authentication type is 'gemini-api-key'",
);

View File

@@ -27,7 +27,7 @@ describe('mixed input crash prevention', () => {
expect(error).toBeInstanceOf(Error);
const err = error as Error;
expect(err.message).toContain('Process exited with code 1');
expect(err.message).toContain('Process exited with code 42');
expect(err.message).toContain(
'--prompt-interactive flag cannot be used when input is piped',
);