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

Allow chaining mockClear and mockReset #4475

Merged
merged 1 commit into from
Sep 13, 2017
Merged

Conversation

iofjuupasli
Copy link
Contributor

Summary

Return mock in mockClear and mockReset to allow chain, e.g. setup right after reset

Test plan

const mock = jest.fn();
mock.mockReset().mockImplementation(() => 1);

@facebook-github-bot
Copy link
Contributor

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@codecov-io
Copy link

Codecov Report

Merging #4475 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4475      +/-   ##
==========================================
+ Coverage   56.84%   56.85%   +0.01%     
==========================================
  Files         186      186              
  Lines        6298     6300       +2     
  Branches        3        3              
==========================================
+ Hits         3580     3582       +2     
  Misses       2717     2717              
  Partials        1        1
Impacted Files Coverage Δ
packages/jest-mock/src/index.js 84.9% <100%> (+0.11%) ⬆️

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 c4844a6...3a29689. Read the comment docs.

@cpojer cpojer merged commit 8bc795c into jestjs:master Sep 13, 2017
@cpojer
Copy link
Member

cpojer commented Sep 13, 2017

Works for me. Thanks for the PR!

tabrindle pushed a commit to tabrindle/jest that referenced this pull request Oct 2, 2017
@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.

None yet

4 participants