Skip to content

feat(utils): add string reversal utility with TDD#17

Open
jbb-codes wants to merge 2 commits into
buwebdev:mainfrom
jbb-codes:feat/add_string_reversal
Open

feat(utils): add string reversal utility with TDD#17
jbb-codes wants to merge 2 commits into
buwebdev:mainfrom
jbb-codes:feat/add_string_reversal

Conversation

@jbb-codes

Copy link
Copy Markdown

Summary

  • Add reverseString function in src/utils/reverseString.js that reverses a string character by character
  • Throws a clear error when given a non-string input
  • Three unit tests written first (TDD) covering: normal reversal, empty string, and invalid input

Test plan

  • should reverse a regular string'hello''olleh'
  • should return an empty string when given an empty string''''
  • should throw an error when given a non-string input123 throws 'Input must be a string'
  • All tests passing via jest

🤖 Generated with [Claude Code]

jbb-codes and others added 2 commits June 2, 2026 16:53
- Add reverseString function that reverses a string character by character
- Throw on non-string input with a clear error message
- Add three unit tests covering normal reversal, empty string, and invalid input

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Ignore node_modules, dist, .env files, logs, .DS_Store, and coverage
- Add clone, install, and test instructions to README

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant