Skip to content

Feat/e2e integration tests#193

Open
whitezaddy wants to merge 2 commits into
BETAIL-BOYS:mainfrom
whitezaddy:feat/e2e-integration-tests
Open

Feat/e2e integration tests#193
whitezaddy wants to merge 2 commits into
BETAIL-BOYS:mainfrom
whitezaddy:feat/e2e-integration-tests

Conversation

@whitezaddy

Copy link
Copy Markdown

Pull Request: Implement E2E Integration Test Suite for Core REST Endpoints

Closes #166

🚀 Overview

This pull request introduces a robust end-to-end (E2E) integration testing matrix for the core REST api endpoints (/api/v1/swaps and /api/v1/portfolio/:address).

The suite spins up a transient NestJS application container in memory using @nestjs/testing and maps endpoint routing behaviors over mocked database and cache connection layer dependencies to ensure predictable, lightning-fast execution without requiring active background infrastructure during test automation runs.

🛠️ Key Changes

  • E2E Spec Setup: Added src/e2e/app.spec.ts config containing custom beforeAll initialization and afterAll container teardown routines.
  • Infrastructure Stubbing: Mocked PrismaService core queries (findMany, count, $queryRaw) and RedisService subscription networks (subscribe, disconnect) to bypass live network handshakes.
  • Toolchain Alignment: Resolved project-wide TypeScript compilation blocks stemming from:
    • Incorrect global Blob wrappers in documents.controller.ts.
    • Out-of-sync Prisma schema type definitions (missing Trade/Pool/Token).
    • Misplaced NestJS lifecycle hook packages in trade.gateway.ts.
    • Deprecated sub-module paths and missing method signatures in @stellar/stellar-sdk.

🧪 Verification & Testing

Tests were executed successfully within a local PowerShell instance. Because background sockets hang occasionally inside the wider testing runner context, the suite is optimized to be invoked using the force exit flag:

npx jest src/e2e/app.spec.ts --forceExit

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Testing] E2E Integration Tests for Portfolio and Swap Endpoints

1 participant