Skip to content

test: add unit tests for error utils and tool description#208

Open
Bortlesboat wants to merge 3 commits intovirattt:mainfrom
Bortlesboat:test/error-utils-coverage
Open

test: add unit tests for error utils and tool description#208
Bortlesboat wants to merge 3 commits intovirattt:mainfrom
Bortlesboat:test/error-utils-coverage

Conversation

@Bortlesboat
Copy link
Copy Markdown

Summary

  • Adds 51 unit tests across 2 new test files for previously untested utility modules
  • errors.test.ts (42 tests) — covers parseApiErrorInfo, all 6 is*Error helpers, classifyError, isNonRetryableError, and formatUserFacingError
  • tool-description.test.ts (9 tests) — covers getToolDescription formatting for tickers, searches, date ranges, periods, and limit counts

Test plan

  • All 87 tests pass (51 new + 36 existing)
  • Zero failures, no new dependencies

Add comprehensive test coverage for two previously untested utility modules:

- errors.ts (42 tests): parseApiErrorInfo, classifyError, all is*Error
  helpers, isNonRetryableError, and formatUserFacingError including edge
  cases like Chinese context overflow messages and TPM disambiguation
- tool-description.ts (9 tests): getToolDescription formatting for
  ticker, search, date range, period, and remaining-args cases
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