MetaMask / MetaMask/metamask-extension

Some test modules are not covered by ESLint test rules

Open
#27,544 0 comments 0 reactions 1 assignee View on GitHub

@Gudahtt is already working on this.

Since Oct 2, 2024.

area-testSuite Sev3-low team-extension-platform type-bug
Dominant language
TypeScript
Stars
13.2k
Forks
5.6k
Avg merge
2d 5h
Merged PRs (30d)
451

Description

### Describe the bug

Many of our Jest test modules are not covered by our ESLint rules for Jest. The ESLint configuration was using a hard-coded list of test modules/directories that differs from the file globs used in the Jest config.

### Expected behavior

The Jest lint rules should be applied to all Jest files (i.e. the same set of files listed [here](https://github.com/MetaMask/metamask-extension/blob/5639952a1012e5da01b98cd2bb33ce7158101067/jest.config.js#L29) in the Jest configuration).

### Screenshots/Recordings

N/A

### Steps to reproduce

Here is an example the problem: https://github.com/MetaMask/metamask-extension/blob/5639952a1012e5da01b98cd2bb33ce7158101067/app/scripts/controllers/decrypt-message.test.ts#L232

This return statement is disallowed by `jest/no-test-return-statement`, but our linter is passing because Jest rules are not being applied to that file.

### Error messages or log output

N/A

### Detection stage

On the development branch

### Version

N/A

### Build type

N/A

### Browser

N/A

### Operating system

Other (please elaborate in the "Additional Context" section)

### Hardware wallet

_No response_

### Additional context

_No response_

### Severity

_No response_

Contributor guide

Open the contributing guide

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.