Files
codetyper.cli/tests/string-helpers.test.ts
Carlos Gutierrez 187cc68304 Improve agent autonomy and diff view readability
Agent behavior improvements:
  - Add project context detection (tsconfig.json, pom.xml, etc.)
  - Enforce validation after changes (tsc --noEmit, mvn compile, etc.)
  - Run tests automatically - never ask "do you want me to run tests"
  - Complete full loop: create → type-check → test → confirm
  - Add command detection for direct execution (run tree, run ls)

  Diff view improvements:
  - Use darker backgrounds for added/removed lines
  - Add diffLineBgAdded, diffLineBgRemoved, diffLineText theme colors
  - Improve text visibility with white text on dark backgrounds
  - Update both React/Ink and SolidJS diff components

  Streaming fixes:
  - Fix tool call argument accumulation using OpenAI index field
  - Fix streaming content display after tool calls
  - Add consecutive error tracking to prevent token waste

  Other changes:
  - ESC to abort operations, Ctrl+C to exit
  - Fix model selection when provider changes in cascade mode
  - Add debug logging for troubleshooting
  - Move tests to root tests/ folder
  - Fix banner test GRADIENT_COLORS reference
2026-01-29 07:33:30 -05:00

25 lines
893 B
TypeScript

import { capitalizeWords } from '../src/utils/string-helpers';
describe('capitalizeWords', () => {
it('should capitalize the first letter of each word in a string', () => {
expect(capitalizeWords('hello world')).toBe('Hello World');
expect(capitalizeWords('capitalize each word')).toBe('Capitalize Each Word');
});
it('should handle empty strings', () => {
expect(capitalizeWords('')).toBe('');
});
it('should handle strings with multiple spaces', () => {
expect(capitalizeWords(' hello world ')).toBe(' Hello World ');
});
it('should handle strings with special characters', () => {
expect(capitalizeWords('hello-world')).toBe('Hello-World');
expect(capitalizeWords('hello_world')).toBe('Hello_World');
});
it('should handle strings with numbers', () => {
expect(capitalizeWords('hello 123 world')).toBe('Hello 123 World');
});
});