Skip to content

SDK #50 — Write end-to-end integration tests against a live local backend #235

@Tinna23

Description

@Tinna23

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    sdkSDK package (packages/sdk/)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions