Skip to content

[Testing] Fix telemetry-improvements.test.ts emitTelemetryUpdate mock assertions #255

Description

@devin-ai-integration

Domain: Testing


Issue [Bug] Fix telemetry-improvements.test.ts emitTelemetryUpdate mock assertions

Tier: 🟡 Medium

Description:

  • Problem: In tests/telemetry-improvements.test.ts, property-based tests using fast-check assert that emitTelemetryUpdate is called during bulk telemetry ingestion. However, the mock for telemetry.service.js replaces bulkIngestTelemetry entirely, so the real service code that calls emitTelemetryUpdate never executes. The mock needs to either:
    (a) Use the real bulkIngestTelemetry implementation with mocked dependencies, or
    (b) Have the mock's bulkIngestTelemetry explicitly call the mocked emitTelemetryUpdate.
  • Implementation: Restructure the test so the mocked bulkIngestTelemetry is wired to call emitTelemetryUpdate with the correct payload, or use a spy that wraps the real implementation while intercepting socket calls.

Dependencies:

  • Depends on None

Acceptance Criteria:

  • emitTelemetryUpdate is verifiably called during bulk ingest in tests.
  • Property-based tests with fast-check pass for all generated inputs.
  • Payload structure validation tests pass.

Testing Requirements:

  • Run npm test -- tests/telemetry-improvements.test.ts and verify all tests pass.
  • Run npm test to confirm no regressions.

PR Checklist:

  • Branch is named conventionally (e.g., fix/issue-XX-telemetry-improvements-mocks).
  • npm run lint and npm run build pass with zero warnings.
  • Screenshot of passing Jest terminal logs is attached to the PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar WaveIssues in the Stellar wave program

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions