Overview
The StreamForge API needs integration tests to ensure reward calculation endpoints behave correctly end-to-end before any payout logic is triggered on the Stellar blockchain.
What needs to be done
- Set up a testing environment using NestJS testing utilities
- Write integration tests for the following scenarios:
- Valid contributor with calculated rewards returns correct payout amount
- Contributor with zero score returns zero reward
- Missing or invalid contributor ID returns proper error
- Unauthorized request returns
401
- Place all test files under the existing
test/ directory
- Use
supertest for HTTP-level integration testing
Acceptance Criteria
Notes
This is critical before connecting real Stellar payout logic. A broken reward calculation that reaches the blockchain cannot be reversed. Test coverage here protects contributors from incorrect payouts.
Overview
The StreamForge API needs integration tests to ensure reward calculation endpoints behave correctly end-to-end before any payout logic is triggered on the Stellar blockchain.
What needs to be done
401test/directorysupertestfor HTTP-level integration testingAcceptance Criteria
test/directorynpm run test:e2eNotes
This is critical before connecting real Stellar payout logic. A broken reward calculation that reaches the blockchain cannot be reversed. Test coverage here protects contributors from incorrect payouts.