Testing

What each layer of tests covers and how to run it.

LayerWhat it coversRun
Program, unit (Rust)Jurisdiction matching and account sizingcargo test --lib in contracts/
Program, integrationThe compiled program with the TypeScript library, in-process on LiteSVM: who may initialize and register, transfers through the hook, the cap at its boundarybun test contracts
Program, regression and securityThe hook refuses to run outside a transfer, a forged recipient is rejected, revoked investors cannot move units, and the known minting gap is pinnedbun test contracts
Library, unitDistribution math, settlement amounts and token programs, instruction encoding, eligibilitybun test packages
Indexer, unit (Rust)Event classification and exactly-once storagecargo test --manifest-path apps/indexer/Cargo.toml
App, unit and regressionDerived figures, error explanations, request shapebun test apps/app
End to end, devnetThe full lifecycle with assertions; the API flow including Sumsubbun run demo, bun apps/api/smoke.ts
End to end, browserChrome drives the app against devnet: connect, fund, approval, subscribe, portfolio, transfer, and a refused transferbun apps/app/e2e/investor-flow.ts

bun test runs every TypeScript suite and needs no network.

The program tests load contracts/tests/fixtures/tsamara_compliance.so. Run bun run --cwd contracts build after changing the program, so they do not test a stale binary.

Against a deployment

API=https://api.tsamara.xyz INDEXER=https://indexer.tsamara.xyz ADMIN_TOKEN=... bun apps/api/smoke.ts

Continuous integration

Every pull request runs three jobs: lint, typecheck and the TypeScript suites; the indexer's Rust tests; and the program's tests.

On this page