Skip to content

Add unit test suite for AnalyticsModule #11

Description

@Code-Paragon

Problem

There are no tests verifying that the AnalyticsModule correctly fetches and parses the Total Value Locked (TVL) from the Soroban RPC.

Expected behavior

A new test file analytics.test.ts is created that mocks the Stellar RPC response and verifies that getTVL returns the correct human-readable decimal string.

Files to update

  • tests/analytics.test.ts (create)

Project relevance

Ensures that the primary metrics module functions correctly without requiring a live connection to the Stellar testnet during CI runs.

Acceptance criteria

  • Feature works as described
  • Tests are added or updated where needed
  • Documentation is updated where needed
  • this.client.rpcServer.simulateTransaction is mocked using Jest to return a mock XDR payload
  • No TypeScript, lint, test, or build errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions