MetaMask / MetaMask/metamask-extension

Improve documentation for unit tests fitness function rule

Open
#18,946 0 comments 0 reactions 0 assignees View on GitHub
team-extension-platform
Dominant language
TypeScript
Stars
13.2k
Forks
5.6k
Avg merge
2d 5h
Merged PRs (30d)
451

Description

If someone needs to add tests to a file that already uses sinon, their build will fail with an error.

Currently, we point the developer to [generic documentation](https://github.com/MetaMask/metamask-extension/blob/develop/development/fitness-functions/rules/index.ts#L9) about unit tests when this rule fails.

We should point the user instead to the options he has for dealing with rule violations, namely:

a) refactor the existing test file as part of the same PR where they are trying to add new test cases or,
b) create a new test file for the new test cases without changing any of the existing cases

Contributor guide

Open the contributing guide

Research direction

Start with development/fitness-functions/rules/index.ts at the linked unit-test documentation reference. Review how the rule reports violations, then update the guidance to describe refactoring the existing test file or creating a new test file; done means the failure points to these options instead of the generic documentation.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
documentation, testing
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.