Skip to content

Improve test coverage and add troubleshooting docs#491

Open
Dark-Brain07 wants to merge 7 commits intostx-labs:mainfrom
Dark-Brain07:main
Open

Improve test coverage and add troubleshooting docs#491
Dark-Brain07 wants to merge 7 commits intostx-labs:mainfrom
Dark-Brain07:main

Conversation

@Dark-Brain07
Copy link
Copy Markdown

Description

Hey, I was going through the connect package and noticed test coverage was pretty limited - just 2 test files for the whole thing. Also there wasn't really any troubleshooting guide for developers running into issues.

So I added tests for the utility functions that weren't covered (things like network conversion, Clarity value handling, Taproot address detection), improved the docs with better JSDoc comments, and wrote up a troubleshooting section in the README covering the common problems I've seen developers run into.

I also threw in a few extra error codes that seemed useful and a helper function to make error handling cleaner.

Changes:

  • New test files for utils.ts, errors.ts, storage.ts, auth.ts
  • Better JSDoc documentation in utils.ts
  • README now has troubleshooting section with common issues
  • Added error codes like NetworkError, TimeoutError, ProviderNotFound
  • New isJsonRpcError() helper for cleaner error handling

Type of Change

  • New feature
  • Bug fix
  • API reference/documentation update
  • Other

Does this introduce a breaking change?

Nope, everything is additive. No breaking changes.

Are documentation updates required?

  • Already included - README troubleshooting section and JSDoc improvements

Testing information

  1. Run npm test in packages/connect to verify
  2. Not a bug fix
  3. Touches utils.ts, errors.ts, storage.ts, auth.ts
  4. No other projects affected
  5. All new tests should pass, no changes to existing behavior

Checklist

  • Code is commented where needed
  • Unit test coverage for new or modified code paths
  • Changelog is updated
  • Tag @jannik-stacks for review

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