lambdaclass / lambdaclass/eth-agent

Test mocks use 'any' types - loses type safety

Open
#17 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

code-quality low-priority testing
Dominant language
TypeScript
Stars
10
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Problem

Mock objects in tests are typed as any, losing type safety benefits.

Location

test/agent/wallet.test.ts:41-45

Current Code

let mockRpc: any;
let mockEns: any;
let mockGasOracle: any;

Recommendation

  • Create proper mock types or use vitest's mock typing
  • Consider using vi.mocked<T>() patterns consistently

Priority

Low - Test quality

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with test/agent/wallet.test.ts:41-45 and inspect how the mock objects are used. Replace the any-typed mocks with proper mock types or Vitest's vi.mocked() pattern, then confirm the test mocks retain type safety without changing their behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
testing
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.