Skip to content

test: expand wallet, network, and logger test coverage - #371

Merged
k-deejah merged 2 commits into
Sorokit:mainfrom
aabxtract:test/264-262-258-coverage
Jul 31, 2026
Merged

test: expand wallet, network, and logger test coverage#371
k-deejah merged 2 commits into
Sorokit:mainfrom
aabxtract:test/264-262-258-coverage

Conversation

@aabxtract

@aabxtract aabxtract commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Summary

Expands test coverage for the wallet adapters, network resolution, and shared logger. All three test files pass locally via npm test.

Wallet adapters (src/tests/wallet.test.ts)

Both XBullAdapter and LobstrAdapter now mirror the existing FreighterAdapter coverage:

  • XBullAdapter.disconnect() — returns status: "ok" with undefined data.
  • XBullAdapter.signTransaction() — returns WALLET_BROWSER_ONLY in a Node environment.
  • LobstrAdapter.disconnect() — returns status: "ok" with undefined data.
  • LobstrAdapter.signTransaction() — returns WALLET_BROWSER_ONLY in a Node environment.

Since all three adapters share the same swkSignTransaction helper (including the isUserRejection branch), this closes the gap where the same bugs could exist independently in all three.

Network resolution (src/tests/network.test.ts)

  • resolveNetwork("testnet", { horizonUrl, rpcUrl }) with both overrides applied simultaneously, asserting networkPassphrase is unchanged.
  • Confirms networkPassphrase is never overridable via NetworkOverrides.
  • resolveNetwork("testnet", {}) (empty overrides object) returns the base config unchanged.

Shared logger (src/tests/logger.test.ts)

New tests were added to the existing createLogger suite (existing withLogging and client-integration tests preserved):

  • createLogger({ debug: false }) — all four methods are callable and produce no output.
  • createLogger({ debug: true }) — calls console.debug with the [sorokit] prefix.
  • Each log level (debug, info, warn, error) is asserted against the correct console method.
  • meta is passed through to console output when provided.
  • A custom logger is never called when debug: false.

Test output

✓ src/tests/network.test.ts (40 tests)
✓ src/tests/logger.test.ts (19 tests)
✓ src/tests/wallet.test.ts (88 tests)

Test Files  3 passed (3)
     Tests  147 passed (147)

closes #264 closes #262 and closes #258

@drips-wave

drips-wave Bot commented Jul 31, 2026

Copy link
Copy Markdown

@aabxtract Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@k-deejah
k-deejah merged commit c4be800 into Sorokit:main Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants