docs: add docs/testing-guide.md — SDK test authoring guide - #396
Merged
BigBen-7 merged 3 commits intoJul 26, 2026
Merged
Conversation
…ios#278) Adds a comprehensive testing guide covering: - Unit test setup using createMockClient, createMockServer, createMockKeypair helpers - Mocking Soroban RPC responses with jest.spyOn and direct server injection - Testing read methods and write methods with mock servers - Integration test setup: required env vars, Friendbot account funding - XDR fixture pattern for capturing and replaying Soroban responses - Coverage thresholds (≥80% statements/functions/lines, ≥75% branches) - PR checklist for new module methods Closes Lead-Studios#278
|
@BashMan11 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! 🚀 |
…s#279) Adds @deprecated JSDoc annotations to all patterns identified during source audit: - buildContractCall(): marks the unused 'server' parameter as deprecated (silently ignored; will be removed in 0.3.0 — pass server to simulateTransaction) - SplitterModule.createRevenueSplit(): deprecated in favour of the generic createSplit({ recipients, totalAmount }) which accepts any number of recipients - RevenueSplitParams interface: deprecated alongside createRevenueSplit(); callers should use SplitRecipient[] + CreateSplitParams directly - WatchOptions re-export from './client' in index.ts: removes duplicate export (canonical source is types/index.ts; no consumer-facing impact) Creates docs/deprecated.md cataloguing all deprecated symbols with: - Deprecated-in / removed-in version numbers (0.2.0 / 0.3.0) - Migration code examples for each deprecated pattern - Summary table Closes Lead-Studios#279
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
docs/testing-guide.md— a comprehensive guide for contributors who need to write both unit tests (mocked RPC) and integration tests (Stellar Testnet) for the SDK.What's included
createMockClient,createMockServer, andcreateMockKeypairfromtests/helpers/mocks.tsjest.spyOnand direct server injection patterns with examplessimulateReadpath with happy-path and error casessendTransaction/getTransaction, verifyingREAD_ONLY_CLIENTguardFiles touched
docs/testing-guide.md(new)Testing
Documentation change — no code modified. Verified all code examples are consistent with the existing test patterns in
tests/token.test.ts,tests/helpers/mocks.ts, and the integration test files.Closes #278