-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Fixed the bug where mocking a file with the filename resolved as backticks would fail #5426
Conversation
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! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
Codecov Report
@@ Coverage Diff @@
## master #5426 +/- ##
=======================================
Coverage 62.18% 62.18%
=======================================
Files 205 205
Lines 6928 6928
Branches 3 4 +1
=======================================
Hits 4308 4308
Misses 2619 2619
Partials 1 1 Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless I misunderstand, the added test does not cover the original issue. See inline comment
CHANGELOG.md
Outdated
@@ -7,6 +7,7 @@ | |||
|
|||
### Fixes | |||
|
|||
* `[mock]` Add backticks support (\`\`) to `mock` a certain package via the `__mocks__` folder. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please include a link to this PR
@@ -44,6 +45,7 @@ jest.mock('../__test_modules__/e', () => { | |||
}, | |||
}; | |||
}); | |||
jest.mock('../__test_modules__/jest-backticks'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this use backticks?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're absolutelly right, I was testing if the backticks were really working and forgot to update this. Thanks :)
…angelog with the PR link
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
CHANGELOG.md
Outdated
@@ -7,6 +7,7 @@ | |||
|
|||
### Fixes | |||
|
|||
* `[mock]` Add backticks support (\`\`) to `mock` a certain package via the `__mocks__` folder.([#5426](https://github.com/facebook/jest/pull/5426)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be [jest-mock]
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. I meant to fix that - forgot, though. Thanks!
…ticks would fail (jestjs#5426) * Fixed the bug where mocking a file with the filename resolved as backticks would fail * Updated changelog * Added license info * Fixed the unit test related to the backticks issue and updated the changelog with the PR link * Update CHANGELOG.md * Update CHANGELOG.md
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. |
Summary
Related with issue #5368
This fixes a bug that needed the following conditions:
__mocks__
folder.mock
function with backticks (``).Test plan
Added tests to the
babel-plugin-jest-hoist
package. Also added a__mocks__
folder there to replicate this issue.