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

docs: describe how to mock/spy class specific method #12257

Merged
merged 7 commits into from
Feb 14, 2022

Conversation

holylander
Copy link
Contributor

@holylander holylander commented Jan 18, 2022

Summary

I believe it would be useful for other users to know how to mock/spy just some method of a class.
Following these examples here:
https://stackoverflow.com/a/56565849/1538604

Test plan

no test required, this is just documentation

I believe it would be useful for other users to know how to mock/spy just some method of a class.
Following these examples here:
https://stackoverflow.com/questions/50091438/jest-how-to-mock-one-specific-method-of-a-class
Copy link
Contributor

@Biki-das Biki-das left a comment

Choose a reason for hiding this comment

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

LGTM. could you try to add these in the main docs folder along with all the other versioned docs

@holylander
Copy link
Contributor Author

thanks @Biki-das!!
Please could you explain that a bit more? I dont know what you mean with the main docs folder...
This is just an edit of this file website/versioned_docs/version-27.4/Es6ClassMocks.md

Thanks very much

@Biki-das
Copy link
Contributor

thanks @Biki-das!! Please could you explain that a bit more? I dont know what you mean with the main docs folder... This is just an edit of this file website/versioned_docs/version-27.4/Es6ClassMocks.md

Thanks very much

150832895-b580d8d8-2f6c-4541-ae01-1637706b3164

@holylander
Copy link
Contributor Author

holylander commented Jan 25, 2022

@Biki-das got it ;)
I just updated the main docs related file as well

@codecov-commenter
Copy link

codecov-commenter commented Jan 25, 2022

Codecov Report

Merging #12257 (5b62f85) into main (5dc4877) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #12257   +/-   ##
=======================================
  Coverage   68.48%   68.48%           
=======================================
  Files         324      324           
  Lines       16969    16969           
  Branches     5061     5061           
=======================================
  Hits        11622    11622           
  Misses       5315     5315           
  Partials       32       32           

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 5dc4877...5b62f85. Read the comment docs.

Copy link
Contributor

@Biki-das Biki-das left a comment

Choose a reason for hiding this comment

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

looks good.

@holylander
Copy link
Contributor Author

@Biki-das
Great! could you approve then ? thanks

@Biki-das
Copy link
Contributor

@Biki-das
Great! could you approve then ? thanks

I am not a official maintainer of this repo, i just contribute and help out to contribute, @SimenB approves it

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, thanks! could you also add this to the other versioned docs?

also, prettier will yell at you, just run yarn lint:prettier to fix it 🙂

@holylander
Copy link
Contributor Author

hey @SimenB , sorry for the late update.
I have updated the rest of the versioned docs, and also run prettier aganist the changes, to ensure the correct format :)

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.

thanks!

@SimenB SimenB changed the title describe how to mock/spy class specific method docs: describe how to mock/spy class specific method Feb 14, 2022
@SimenB SimenB merged commit f130aff into jestjs:main Feb 14, 2022
@holylander holylander deleted the patch-1 branch February 14, 2022 07:54
@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 Mar 17, 2022
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.

5 participants