Skip to content

feat(transactions): add comprehensive tests and JSDoc documentation - #1835

Open
Dark-Brain07 wants to merge 1 commit into
stx-labs:mainfrom
Dark-Brain07:feat/improve-test-coverage-and-docs
Open

feat(transactions): add comprehensive tests and JSDoc documentation#1835
Dark-Brain07 wants to merge 1 commit into
stx-labs:mainfrom
Dark-Brain07:feat/improve-test-coverage-and-docs

Conversation

@Dark-Brain07

Copy link
Copy Markdown

Summary

This PR improves test coverage and documentation for the @stacks/transactions package.

Changes

  • utils.test.ts: Added 11 test suites for previously untested utility functions including leftPadHex, hash160, isClarityName, cvToHex, hexToCV, parseReadOnlyResponse, and parseContractId
  • utils.ts: Added JSDoc documentation with examples for 7 utility functions
  • errors.ts: Added JSDoc documentation to all error classes
  • units.test.ts: Reorganized with describe blocks and added edge case tests (zero values, large values, round-trip conversions)

Why

The utils.test.ts previously only tested 1 of 25+ functions. This PR significantly improves test coverage and makes the codebase more developer-friendly with better documentation.

Testing

All existing tests continue to pass. New tests verify edge cases and expected behavior.

…umentation

- Add 11 test suites for previously untested utility functions

- Add JSDoc documentation to leftPadHex, leftPadHexToLength, rightPadHexToLength, exceedsMaxLengthBytes, hash160, isClarityName, validateStacksAddress

- Add JSDoc documentation to error classes (SerializationError, DeserializationError, etc.)

- Enhance units.test.ts with edge case tests and organized describe blocks
@Dark-Brain07
Dark-Brain07 force-pushed the feat/improve-test-coverage-and-docs branch from 458b56a to dea832d Compare February 14, 2026 09:50
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.

2 participants