-
-
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
Global functions: add pretty error for syntax error. #6901
Conversation
Provide explanation that configuration transform entry is not working on the global functions.
46174f8
to
37942c8
Compare
Codecov Report
@@ Coverage Diff @@
## master #6901 +/- ##
=========================================
Coverage ? 66.92%
=========================================
Files ? 250
Lines ? 10383
Branches ? 4
=========================================
Hits ? 6949
Misses ? 3433
Partials ? 1
Continue to review full report at Codecov.
|
This loses the |
@SimenB Do you think the approach of better message on error is wrong? |
@binygal sorry about not responding earlier. I do think providing a better message is the right thing to do, but your current approach removes the syntax error itself making it harder for the user to track down their error. My local playing around (that I don't think I have available anywhere anymore) basically re-added the information that was lost, and added a code frame. If you can accomplish something like that'd, I'd love to merge it 🙂 |
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. |
Provide explanation that configuration transform entry is not working
on the global functions.
Summary
Right now Jest is not running transformation on setup and teardown global functions and this is confusing for the users, this PR prettify the error message on syntax error to note that transform is not supported in global functions. (#5164)
Test plan
Check that the new copy is actually printed to the screen as can be seen in the provided screenshots.
(2 tests added, using an invalid globalSetup and globalTeardown, and matching the process stderr against a regex with the "not supported" copy)