MetaMask / MetaMask/metamask-extension
Some test modules are not covered by ESLint test rules
@Gudahtt is already working on this.
Since Oct 2, 2024.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.