Skip to content

Add unit tests for data-anonymization service #1281

Description

@RUKAYAT-CODER

Overview

src/common/utils/data-anonymization.service.ts has no accompanying *.spec.ts, so its behaviour is unverified and easy to regress. Add focused unit tests covering the service's public methods, including the main success paths and the error/edge cases.

Specifications

Features:

  • The service has unit tests covering its public API.
  • Both happy-path and failure/edge-case behaviour is asserted.

Tasks:

  • Create src/common/utils/data-anonymization.service.spec.ts with a NestJS Test.createTestingModule setup and mocked dependencies.
  • Cover each public method: expected result on success, and error handling on invalid input / dependency failure.
  • Ensure the new tests run and pass under the existing Jest config.

Impacted Files:

  • src/common/utils/data-anonymization.service.ts
  • src/common/utils/data-anonymization.service.spec.ts

Acceptance Criteria

  • Every public method of the service has at least one test.
  • Success and failure/edge-case paths are both asserted.
  • The suite passes in CI.

Activity

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

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions