Skip to content

SDK Integration Smoke Test Harness #551

Description

@Kingsman-99

Description

The SDK lacks an end-to-end smoke test suite that exercises the full happy-path flow — create invoice, preflight check, submit payment, verify receipt, check finality — against Stellar testnet using real Horizon calls and funded test accounts. Without this harness, regressions in Horizon API compatibility, @stellar/stellar-sdk upgrades, or cross-module integration are only caught in production. A smoke test harness should run this flow as a CI-gated integration test.

Technical Context

Add tests/integration/smokeTest.ts. Uses @stellar/stellar-sdk Keypair.random() and the testnet faucet endpoint (https://friendbot.stellar.org) to fund test accounts. Calls StellarSplitClient from src/client.ts with a testnet config. Invokes createInvoice(), preflightCheck(), submitPayment(), getReceipt(), and FinalityChecker.check(). Asserts each step returns the expected typed result. Controlled by STELLAR_TESTNET_SMOKE=1 environment variable to avoid running on every unit test pass.

Acceptance Criteria

  • Smoke test funds two Keypair accounts (payer and recipient) via friendbot and creates a 2-recipient invoice with a 60/40 split
  • Calls StellarSplitClient.preflightCheck() and asserts all preflight checks pass before submission
  • Submits the payment and waits for finality via FinalityChecker.check() with minConfirmations: 2
  • Asserts PaymentReceipt.status === 'finalized' and effectSummary reflects the correct balance deltas for both recipients
  • Test is skipped when STELLAR_TESTNET_SMOKE is not set and is explicitly tagged as @integration to exclude from the default npm test run
  • All CI checks (npm test, npm run build, ESLint/TypeScript) pass and the branch has no merge conflicts

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions