Skip to content

Add Comprehensive Integration Tests for Markets Endpoint#18

Open
HermanKoii wants to merge 5 commits into
Merango:61533bb5-fa6e-4c8a-b1fa-ab748d46e7c1from
HermanKoii:test-market-data-endpoint-1749235081
Open

Add Comprehensive Integration Tests for Markets Endpoint#18
HermanKoii wants to merge 5 commits into
Merango:61533bb5-fa6e-4c8a-b1fa-ab748d46e7c1from
HermanKoii:test-market-data-endpoint-1749235081

Conversation

@HermanKoii
Copy link
Copy Markdown

@HermanKoii HermanKoii commented Jun 6, 2025

Add Comprehensive Integration Tests for Markets Endpoint

Description

Task

Write integration tests for market data endpoint

Acceptance Criteria

  • Integration tests cover main market data endpoint functionality
  • Tests validate response structure and data integrity
  • Error cases for invalid parameters are handled
  • Pagination and sorting work as expected

Summary of Work

This pull request adds a robust set of integration tests for the markets endpoint, ensuring comprehensive coverage of functionality and edge cases.

Changes Made

  • Implemented integration tests for markets endpoint in tests/integration/markets.test.ts
  • Covered multiple test scenarios including:
    1. Successful market data retrieval
    2. Input validation for currency parameters
    3. Pagination and per_page parameter handling
    4. Sorting order validation

Implementation Details

  • Used Vitest and Supertest for integration testing
  • Tested multiple query parameter combinations
  • Validated response structure and data integrity
  • Implemented error case scenarios

Test Coverage

  • Successful request with default parameters
  • Invalid currency parameter handling
  • Invalid page number validation
  • Per_page parameter enforcement
  • Different sorting order support

Notes

  • Tests use mock application created via createApp()
  • Assumes existing markets route implementation
  • Uses realistic test data and scenarios

Recommendations

  • Consider adding more edge case tests in future iterations
  • Potential improvement: More granular error message testing

Changes Made

  • Added comprehensive integration tests for markets endpoint
  • Implemented multiple test scenarios in tests/integration/markets.test.ts
  • Validated response structure, pagination, and error handling

Tests

  • Validate successful market data retrieval
  • Test invalid currency parameter handling
  • Verify pagination functionality
  • Check different sorting order support
  • Ensure per_page parameter works correctly

Signatures

Staking Key

3JF13GJW2UeYuTTRJQBdBD9bHP6Zj1QLMyXBMoAP2r5Y: F6vpeEFAbbaRGVa4wm97T6sRYsxMGnyaLqq35CtrAzfv3MYJwcNu7CHuy2CX1moEhMWGRHn6ddbcceFKgp6xhWQXR84RVwxHUqEx6e7V4uW88YAFbeTGekE8krUwytEjWy7vGDhCc7LxwARw5wVwqFFzysxEYSPptUvYqcXL5ZRPCfYzcFpZEZfcywFsdnxHDznFdesttD97nZtRTrgAWG2cLow7xdmrsDiA7Bx86nmjh3vgtgQKeZjHwm1zQii6rjMrH2UfZEJ67o9hBBDmNxVmvxuLaDxNouKftNH4Wk27HHAc3WCFXTvbCxMVPg9N2v6ZCZayeUjQJcrzv2AgKowTKeyQheG79qiEB4ZF8G9y8eTLhCzfA8Ju8h5Sbo1LMP2bX1eqNTd6JwVMBJGkCTcMnmE8HqBEpt

Public Key

H2j8Cz7zKCeuDTs73vtjDtBmtytQX1JyaQqvYwwQWE6p: 2YameRjuiN4ryT2tMppmy6SSaN4n1XqTQTBoNryYmDL5rkTRDwNYG6Z6XCdng3eTztawa1DbvrG9sBEjfjLi7uKTgg3TPGRAcmE7vaHWoY6mNpMU1rAJ7Zxg6kY52CU5FjrSzQ3YrNL5ru4DgauE6CfZsevoVFriG14AVagLSa1HU6iVdhSeSFij5CAxu3ZpS2JcGAs25gTGdyDMGUBJnSkQsK4moNdUrt2H7sxkqYad8cE1cHMXoqiEHFVtN2TNY6jqYSMUePrbK421KiHoFSMdffiafjnqDrxLskiCnbgYPLApqMMi9mp1v1g94AWs3rFkZAeE1g8DRMcRq1if7sK6XgP8zFjEpzaUUpRE3ZFMZB89fMk6zUjwWmeduPMnngtwaSVUrurPHjK97VjsgnuM7Z8geLFvnQ

@HermanKoii HermanKoii changed the title [WIP] Add Integration Tests for Market Data Endpoint Add Comprehensive Integration Tests for Markets Endpoint Jun 6, 2025
@HermanKoii HermanKoii marked this pull request as ready for review June 6, 2025 18:40
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.

1 participant