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

Fixes automocks when using resolvers #6036

Merged
merged 1 commit into from
Apr 20, 2018

Conversation

arcanis
Copy link
Contributor

@arcanis arcanis commented Apr 19, 2018

Summary

#4174 introduced a few lines of code that broke automocking when using custom resolvers (reported as #4985). This new diff reverts the part of the code responsible for the breakage.

I'm not entirely sure what was the purpose of the previous code - if I understand correctly it was ensuring that resolvers were correctly called when calling require() from within a mock, but I added an integration test and it seems to work fine even with the code removed.

Maybe @midzelis can shed some light on this?

Test plan

I've added a test to make sure that automocking would continue working, removed a unit test that was testing the behavior of getMockModule (since it was testing the behavior causing the bug), and added a new test to make sure that require() calls work with manual mocking + custom resolvers.

@codecov-io
Copy link

Codecov Report

Merging #6036 into master will decrease coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6036      +/-   ##
==========================================
- Coverage    64.3%   64.28%   -0.02%     
==========================================
  Files         217      217              
  Lines        8317     8314       -3     
  Branches        3        3              
==========================================
- Hits         5348     5345       -3     
  Misses       2968     2968              
  Partials        1        1
Impacted Files Coverage Δ
packages/jest-resolve/src/index.js 96.72% <ø> (-0.08%) ⬇️

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 440e9c6...8c35eb6. Read the comment docs.

@cpojer cpojer merged commit 0722a1e into jestjs:master Apr 20, 2018
@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 12, 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