mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-26 13:04:49 -07:00
Protect stdout and stderr so JavaScript code can't accidentally write to stdout corrupting ink rendering (#13247)
Bypassing rules as link checker failure is spurious.
This commit is contained in:
@@ -20,6 +20,7 @@ import {
|
||||
import { promptIdContext } from '../../utils/promptIdContext.js';
|
||||
import type { Content } from '@google/genai';
|
||||
import type { ResolvedModelConfig } from '../../services/modelConfigService.js';
|
||||
import { debugLogger } from '../../utils/debugLogger.js';
|
||||
|
||||
vi.mock('../../core/baseLlmClient.js');
|
||||
vi.mock('../../utils/promptIdContext.js');
|
||||
@@ -132,7 +133,7 @@ describe('ClassifierStrategy', () => {
|
||||
|
||||
it('should return null if the classifier API call fails', async () => {
|
||||
const consoleWarnSpy = vi
|
||||
.spyOn(console, 'warn')
|
||||
.spyOn(debugLogger, 'warn')
|
||||
.mockImplementation(() => {});
|
||||
const testError = new Error('API Failure');
|
||||
vi.mocked(mockBaseLlmClient.generateJson).mockRejectedValue(testError);
|
||||
@@ -150,7 +151,7 @@ describe('ClassifierStrategy', () => {
|
||||
|
||||
it('should return null if the classifier returns a malformed JSON object', async () => {
|
||||
const consoleWarnSpy = vi
|
||||
.spyOn(console, 'warn')
|
||||
.spyOn(debugLogger, 'warn')
|
||||
.mockImplementation(() => {});
|
||||
const malformedApiResponse = {
|
||||
reasoning: 'This is a simple task.',
|
||||
@@ -252,7 +253,7 @@ describe('ClassifierStrategy', () => {
|
||||
|
||||
it('should use a fallback promptId if not found in context', async () => {
|
||||
const consoleWarnSpy = vi
|
||||
.spyOn(console, 'warn')
|
||||
.spyOn(debugLogger, 'warn')
|
||||
.mockImplementation(() => {});
|
||||
vi.mocked(promptIdContext.getStore).mockReturnValue(undefined);
|
||||
const mockApiResponse = {
|
||||
|
||||
Reference in New Issue
Block a user