Skip to content

Remove 4 explicit any across 4 test files #657

Description

@Omoboi-dev

Description

npm run lint reports 4 @typescript-eslint/no-explicit-any warnings in the files below:

  • test/admin-dispute-resolution.e2e-spec.ts — 1 occurrence
  • test/unit/dlq.service.spec.ts — 1 occurrence
  • test/unit/stellar-webhook.service.spec.ts — 1 occurrence
  • test/unit/tracking-poll.worker.spec.ts — 1 occurrence

any in a test defeats the point of the test: it lets a mock drift out of shape with the real type and still compile, so the suite keeps passing while the thing it mocks has changed. Issue #416 was closed for this and 88 occurrences remain across 15 files, so this is a real remainder rather than a duplicate.

Location

  • test/admin-dispute-resolution.e2e-spec.ts
  • test/unit/dlq.service.spec.ts
  • test/unit/stellar-webhook.service.spec.ts
  • test/unit/tracking-poll.worker.spec.ts

Example commits

refactor(tests): replace explicit any with real types in admin-dispute-resolution.e2e-spec.ts

Acceptance Criteria

  • No @typescript-eslint/no-explicit-any warnings remain in the listed files.
  • Replacements are real types, not unknown casts or eslint-disable comments.
  • Mocks are typed with jest.Mocked<T> or an explicit interface so a signature change breaks compilation.
  • No new tests required, but every existing test in the listed files must still pass.
  • npx tsc --noEmit and npm test both pass.

Technical Notes

jest.Mocked<T> and Partial<T> cover most cases. Where a mock only needs a few methods, type it as an explicit interface rather than casting the whole object.

Out of scope: files not listed above, and changing what the tests assert.

Before you start

Setup, including the Node 22 requirement and the prisma generate step, is in
CONTRIBUTING.md. Authenticated requests in tests
use the bearer() helper in test/auth-helper.ts rather than hand-built
tokens. Branch from dev and open the pull request against dev.

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programcomplexity: medium150 pts. New endpoint, service method, integration testtestadd test

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions