Skip to content

Remove the remaining explicit any occurrences across test files #416

Description

@Omoboi-dev

Category: Testing & Quality
Difficulty: Medium

Description:
After the two largest offenders are dealt with separately, roughly 30 @typescript-eslint/no-explicit-any occurrences remain, spread thinly across about fifteen test files. Individually each is trivial; collectively they are why the codebase does not meet the specification's no-any requirement. Because the rule is a warning, nothing stops the number climbing again after it is cleared.

Location:
src/vendor/analytics/analytics.service.spec.ts
src/common/validators/stellar-address.validator.spec.ts
src/notifications/notifications.service.spec.ts
src/escrow/escrow.service.sync-state.spec.ts
test/unit/tracking-poll.worker.spec.ts
test/unit/escrow.service.spec.ts
test/unit/notifications.service.spec.ts
test/unit/escrow-tracking-cache.spec.ts
test/unit/admin.guard.spec.ts
test/unit/stellar-webhook.service.spec.ts
test/unit/escrow-tracking.spec.ts
test/unit/dlq.service.spec.ts
test/unit/blockchain-listener.service.spec.ts
test/unit/auto-release.worker.spec.ts
test/integration/vendor-analytics.integration-spec.ts
test/integration/escrow.integration-spec.ts
test/integration/escrow-cancellation.integration-spec.ts

Example commits:

refactor(tests): remove remaining explicit any from unit specs
refactor(tests): remove remaining explicit any from integration specs

Acceptance Criteria:

  • Zero no-explicit-any warnings across every file listed
  • No as unknown as X chains or eslint disable comments introduced
  • jest.Mocked<T> is used for service mocks rather than untyped literals
  • All existing tests still pass with no assertion weakened or deleted
  • npm run lint:check reports zero no-explicit-any warnings once this and the two related issues have merged

Technical Notes:
This can be split across several PRs by directory if that is easier to review, but say which files a PR covers. Do not change the eslint configuration here, promoting the rule to an error is a separate issue that depends on this one.


Before you start

  • Setup: CONTRIBUTING.md → Development Setup. Use Node 22 (nvm use), run npm ci rather than npm install, and run npx prisma generate after installing. Skipping that last step makes npm run typecheck fail with Module '"@prisma/client"' has no exported member — a missing step, not a broken checkout.
  • Tests that authenticate: use bearer() from test/auth-helper.ts. Sending a bare Stellar address as a bearer token returns 401. See Writing Tests That Need Authentication.
  • Branch from the latest dev and open your pull request against dev, not main. dev is the default branch; main is the released baseline. If you branched earlier, rebase onto dev.

Metadata

Metadata

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