MetaMask / MetaMask/core

TokenListController tests are brittle

Open
#917 0 comments 1 reaction 0 assignees View on GitHub
team-wallet-framework wf-test-quality-improvement
Dominant language
TypeScript
Stars
413
Forks
308
Avg merge
1d 4h
Merged PRs (30d)
253

Description

there is a lot of setTimeouts used with magic numbers to wait for things that should be handled using promises.

For example, this test fails particularly often:
https://github.com/MetaMask/controllers/blob/main/src/assets/TokenListController.test.ts#L602

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in src/assets/TokenListController.test.ts, especially around line 602, and inspect the other setTimeout calls in the TokenListController tests. Run the affected test to reproduce the intermittent failure, then confirm the tests wait for the relevant promises rather than relying on magic-number delays.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.