Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cli, config, docs): improve mock related cli messages, config template entries and documentation #12047

Merged
merged 1 commit into from
Nov 29, 2021
Merged

Conversation

mrazauskas
Copy link
Contributor

Summary

Follow up of #12019

In the mentioned PR it was spotted that mock.results are not mentioned in clearMocks 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.

@codecov-commenter
Copy link

Codecov Report

Merging #12047 (5b61447) into main (8f2cdad) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #12047   +/-   ##
=======================================
  Coverage   68.77%   68.77%           
=======================================
  Files         324      324           
  Lines       16670    16670           
  Branches     4814     4814           
=======================================
  Hits        11465    11465           
  Misses       5172     5172           
  Partials       33       33           
Impacted Files Coverage Δ
packages/jest-cli/src/init/questions.ts 100.00% <ø> (ø)
packages/jest-config/src/Descriptions.ts 100.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8f2cdad...5b61447. Read the comment docs.

Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is great, thank you!

@SimenB SimenB merged commit 2e6c217 into jestjs:main Nov 29, 2021
@mrazauskas mrazauskas deleted the mocks-clarification branch November 30, 2021 07:35
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants