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

Add a serializer for jest.fn to jest-snapshot #4668

Merged
merged 4 commits into from
Oct 11, 2017

Conversation

SimenB
Copy link
Member

@SimenB SimenB commented Oct 11, 2017

Summary
This adds a serializer to be able to easily assert on the calls of a mock.

This is very easy to implement in userland, so I understand if it's not merged 🙂 But it's been useful for me, so maybe it'll be useful for others?

(I started creating a separate module for this, but I got annoyed that I couldn't use mock.getMockName(), so here's a PR)

Test plan
New tests added

@cpojer
Copy link
Member

cpojer commented Oct 11, 2017

This is clever, I like it. Let's do it.

@cpojer cpojer merged commit afb4bf5 into jestjs:master Oct 11, 2017
@SimenB SimenB deleted the mock-serializer branch October 11, 2017 20:40
@codecov-io
Copy link

Codecov Report

Merging #4668 into master will decrease coverage by <.01%.
The diff coverage is 60%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4668      +/-   ##
==========================================
- Coverage   57.13%   57.13%   -0.01%     
==========================================
  Files         194      195       +1     
  Lines        6565     6569       +4     
  Branches        3        3              
==========================================
+ Hits         3751     3753       +2     
- Misses       2814     2816       +2
Impacted Files Coverage Δ
packages/jest-snapshot/src/plugins.js 100% <100%> (ø) ⬆️
packages/jest-snapshot/src/mock_serializer.js 50% <50%> (ø)

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 1c2dba6...3514516. Read the comment docs.

@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 May 13, 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