mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-07-15 20:40:35 -07:00
fix(cli): conditionally suppress console output in headless and non-interactive modes
This commit is contained in:
@@ -43,6 +43,26 @@ describe('ConsolePatcher', () => {
|
||||
console.error = originalError;
|
||||
});
|
||||
|
||||
it('should NOT suppress console.error even when suppressConsoleOutput is true', () => {
|
||||
const originalError = console.error;
|
||||
const errorSpy = vi.spyOn(console, 'error').mockImplementation(() => {});
|
||||
|
||||
patcher = new ConsolePatcher({
|
||||
debugMode: false,
|
||||
suppressConsoleOutput: true,
|
||||
stderr: true,
|
||||
});
|
||||
patcher.patch();
|
||||
|
||||
console.error('test error');
|
||||
|
||||
expect(errorSpy).toHaveBeenCalled();
|
||||
|
||||
patcher.cleanup();
|
||||
errorSpy.mockRestore();
|
||||
console.error = originalError;
|
||||
});
|
||||
|
||||
it('should NOT suppress output when suppressConsoleOutput is true but debugMode is true', () => {
|
||||
const originalError = console.error;
|
||||
const errorSpy = vi.spyOn(console, 'error').mockImplementation(() => {});
|
||||
|
||||
Reference in New Issue
Block a user