Summary
Add a suite of integration tests that run against a real locally-running Stellar Explain backend (not a mock) to catch any mismatch between the SDK types and actual API responses.
Files to create
packages/sdk/tests/integration/client.integration.test.ts
packages/sdk/tests/integration/README.md
Requirements
- Tests are skipped unless
STELLAR_EXPLAIN_INTEGRATION=true env var is set
- Uses a real
StellarExplainClient with baseUrl: process.env.API_URL ?? 'http://localhost:4000'
- Tests:
health() returns status: 'ok', explainTransaction with known-good hash returns correct shape, explainAccount with known-good address returns correct shape, explainTransaction with unknown hash throws NotFoundError
- Add test fixture file
tests/integration/fixtures.ts with known hash + address for testnet
Notes
These tests will fail in CI unless a backend is running. Add a separate test:integration script to package.json and document in CONTRIBUTING.md how to run them locally.
Summary
Add a suite of integration tests that run against a real locally-running Stellar Explain backend (not a mock) to catch any mismatch between the SDK types and actual API responses.
Files to create
Requirements
STELLAR_EXPLAIN_INTEGRATION=trueenv var is setStellarExplainClientwithbaseUrl: process.env.API_URL ?? 'http://localhost:4000'health()returnsstatus: 'ok',explainTransactionwith known-good hash returns correct shape,explainAccountwith known-good address returns correct shape,explainTransactionwith unknown hash throwsNotFoundErrortests/integration/fixtures.tswith known hash + address for testnetNotes
These tests will fail in CI unless a backend is running. Add a separate
test:integrationscript topackage.jsonand document inCONTRIBUTING.mdhow to run them locally.