Skip to content

[server] - Write Integration Test Suite for All API Routes #79

Description

@dark-sarge

Location: server/src/__tests__/

Description

No integration tests exist for the server API. Unit tests for individual services are insufficient to catch issues in how routes, middleware, database queries, and external service calls interact. A full integration test suite using a real test database and mocked external services is required.

Acceptance Criteria

  • Vitest (or Jest) is configured in server/ with a test script in package.json.
  • A test database is provisioned and migrated before the suite runs; it is torn down afterwards. Tests use isolated transactions that are rolled back after each test case.
  • The following route groups each have an integration test file: auth, trades, wallet, profile, webhooks, admin.
  • External HTTP calls (Termii, Paystack, Stellar/Horizon) are mocked using msw or nock.
  • Each test file covers: successful request (2xx), validation failure (422), auth failure (401/403), and not-found (404) scenarios.
  • Code coverage is reported and a minimum of 80% line coverage is enforced as a CI gate.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions