-
-
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
fix: show better errors from babel-plugin-jest-hoist #8865
Conversation
Codecov Report
@@ Coverage Diff @@
## master #8865 +/- ##
=========================================
Coverage ? 63.85%
=========================================
Files ? 275
Lines ? 11578
Branches ? 2838
=========================================
Hits ? 7393
Misses ? 3558
Partials ? 627
Continue to review full report at Codecov.
|
|
||
// We allow `jest`, `expect`, `require`, all default Node.js globals and all | ||
// ES2015 built-ins to be used inside of a `jest.mock` factory. | ||
// We also allow variables prefixed with `mock` as an escape-hatch. | ||
const WHITELISTED_IDENTIFIERS: Set<string> = new Set([ |
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.
ignoring whitespace is a good idea while reviewing this PR
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.
Looks good! Would be even better to show the path to the module inside codeframe, but not sure how hard would it be to pull it off
The filename is part of the error - would you want it somewhere else? Babel puts it there automatically, I don't deal with the filename |
Yea I've seen that. That's why I'm ok with how it is now. But would be more happy to have something like:
|
Aha! Yeah, that's interesting... Maybe open up an issue at babel/babel? I don't think it's worth it for us to deal with it here |
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
Fixes #8864
Test plan
Before:
After: