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:
Jacob Richman
2025-11-20 10:44:02 -08:00
committed by GitHub
parent e20d282088
commit d1e35f8660
82 changed files with 1523 additions and 868 deletions
@@ -8,6 +8,7 @@ import { vi, describe, it, expect, beforeEach, afterEach } from 'vitest';
import { CommandService } from './CommandService.js';
import { type ICommandLoader } from './types.js';
import { CommandKind, type SlashCommand } from '../ui/commands/types.js';
import { debugLogger } from '@google/gemini-cli-core';
const createMockCommand = (name: string, kind: CommandKind): SlashCommand => ({
name,
@@ -35,7 +36,7 @@ class MockCommandLoader implements ICommandLoader {
describe('CommandService', () => {
beforeEach(() => {
vi.spyOn(console, 'debug').mockImplementation(() => {});
vi.spyOn(debugLogger, 'debug').mockImplementation(() => {});
});
afterEach(() => {
@@ -139,7 +140,7 @@ describe('CommandService', () => {
const commands = service.getCommands();
expect(commands).toHaveLength(1);
expect(commands).toEqual([mockCommandA]);
expect(console.debug).toHaveBeenCalledWith(
expect(debugLogger.debug).toHaveBeenCalledWith(
'A command loader failed:',
error,
);