fix(cli, config, docs): improve mock
related cli messages, config template entries and documentation
#12047
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Follow up of #12019
In the mentioned PR it was spotted that
mock.results
are not mentioned inclearMocks
documentation. I found few more places where results were not mentioned.Also noticed that sometimes instead of "before each test" it was written "between each test". In a way the final result is identical, but "between" sounds like the action will run after a test, not before. "Before" is more precise: https://github.com/facebook/jest/blob/8f2cdad7694f4c217ac779d3f4e3a150b5a3d74d/packages/jest-circus/src/legacy-code-todo-rewrite/jestAdapter.ts#L48-L58
Added missing
--clearMocks
,--resetMocks
,--restoreMocks
to CLI documentation.Fix few more minor details. For instance, added useful links to other pats of documentation.
Test plan
Snapshot updated. All should work.