MetaMask / MetaMask/core

Minimize the use of `/* istanbul ignore */` comments

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

Nobody has claimed this yet.

team-wallet-framework wf-test-quality-improvement
Dominant language
TypeScript
Stars
413
Forks
308
Avg merge
1d 4h
Merged PRs (30d)
253

Description

Jest uses Istanbul under the hood to scan for and report on test coverage. At any point we can instruct Istanbul to exclude a section of code for consideration in the coverage report. However, long-term doing this is not ideal, and we should remove these directives:

* Many of the ignored lines/branches are either dead code, or represent important behaviors that are not being tested. We should delete dead code, and test all expected behaviours.
* The use of ignore comments should be reserved for conditions that are unreachable but still serve a purpose (e.g. type guards, certain validation steps, etc.).

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

Search the repository for `/* istanbul ignore */` comments and review each affected area to determine whether it is dead code, an untested expected behavior, or a genuinely unreachable condition. Remove dead code, add coverage for expected behaviors, and retain only justified exclusions; verify the relevant package tests and coverage reports.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
testing
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.