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
@@ -14,7 +14,7 @@ import {
type Mock,
} from 'vitest';
import { act, useEffect } from 'react';
import { render } from '../../test-utils/render.js';
import { renderWithProviders } from '../../test-utils/render.js';
import { waitFor } from '../../test-utils/async.js';
import { useCommandCompletion } from './useCommandCompletion.js';
import type { CommandContext } from '../commands/types.js';
@@ -132,7 +132,7 @@ describe('useCommandCompletion', () => {
hookResult = { ...completion, textBuffer };
return null;
}
render(<TestComponent />);
renderWithProviders(<TestComponent />);
return {
result: {
get current() {
@@ -516,7 +516,7 @@ describe('useCommandCompletion', () => {
hookResult = { ...completion, textBuffer };
return null;
}
render(<TestComponent />);
renderWithProviders(<TestComponent />);
// Should not trigger prompt completion for comments
expect(hookResult!.suggestions.length).toBe(0);
@@ -549,7 +549,7 @@ describe('useCommandCompletion', () => {
hookResult = { ...completion, textBuffer };
return null;
}
render(<TestComponent />);
renderWithProviders(<TestComponent />);
// Should not trigger prompt completion for comments
expect(hookResult!.suggestions.length).toBe(0);
@@ -582,7 +582,7 @@ describe('useCommandCompletion', () => {
hookResult = { ...completion, textBuffer };
return null;
}
render(<TestComponent />);
renderWithProviders(<TestComponent />);
// This test verifies that comments are filtered out while regular text is not
expect(hookResult!.textBuffer.text).toBe(