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
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.
Description
npm run lintreports 4@typescript-eslint/no-explicit-anywarnings in the files below:test/admin-dispute-resolution.e2e-spec.ts— 1 occurrencetest/unit/dlq.service.spec.ts— 1 occurrencetest/unit/stellar-webhook.service.spec.ts— 1 occurrencetest/unit/tracking-poll.worker.spec.ts— 1 occurrenceanyin 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.tstest/unit/dlq.service.spec.tstest/unit/stellar-webhook.service.spec.tstest/unit/tracking-poll.worker.spec.tsExample commits
Acceptance Criteria
@typescript-eslint/no-explicit-anywarnings remain in the listed files.unknowncasts oreslint-disablecomments.jest.Mocked<T>or an explicit interface so a signature change breaks compilation.npx tsc --noEmitandnpm testboth pass.Technical Notes
jest.Mocked<T>andPartial<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 generatestep, is inCONTRIBUTING.md. Authenticated requests in tests
use the
bearer()helper intest/auth-helper.tsrather than hand-builttokens. Branch from
devand open the pull request againstdev.