Files
smom-dbis-138/test/emoney/api/README.md
defiQUG 76aa419320 feat: bridges, PMM, flash workflow, token-aggregation, and deployment docs
- CCIP/trustless bridge contracts, GRU tokens, DEX/PMM tests, reserve vault.
- Token-aggregation service routes, planner, chain config, relay env templates.
- Config snapshots and multi-chain deployment markdown updates.
- gitignore services/btc-intake/dist/ (tsc output); do not track dist.

Run forge build && forge test before deploy (large solc graph).

Made-with: Cursor
2026-04-07 23:40:52 -07:00

1.7 KiB

API Tests

This directory contains reference contract tests and opt-in integration smoke tests for the eMoney control-plane API surface.

The default repo validation pass does not start an external REST or GraphQL control-plane service, so the integration suites are intentionally opt-in.

Test Structure

test/emoney/api/
├── integration/          # Optional smoke tests against an external API service
│   ├── rest-api.test.ts
│   └── graphql.test.ts
└── contract/             # Contract validation tests
    ├── openapi-validation.test.ts
    └── event-schema-validation.test.ts

Reference API specs used by the contract tests live under test/api/packages/.

Running Tests

# Run all tests
pnpm test

# Run only integration tests
pnpm run test:integration

# Run only contract tests
pnpm run test:contract

# Watch mode
pnpm run test:watch

Test Types

Integration Tests

Test actual API endpoints against running services:

  • REST API operations
  • GraphQL queries and mutations
  • End-to-end flows

Enable them explicitly:

export RUN_EMONEY_API_INTEGRATION=1
export RUN_EMONEY_GRAPHQL_INTEGRATION=1

Contract Tests

Validate that implementations conform to specifications:

  • OpenAPI schema validation
  • AsyncAPI event schema validation
  • Request/response format validation

Mock Servers

Mock server tooling is not checked into this monorepo checkout. If you have an external mock or implementation, point the integration tests at it with environment variables.

export API_URL=http://localhost:3000
export GRAPHQL_URL=http://localhost:4000/graphql
export ACCESS_TOKEN=your-test-token