-
-
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(jest-transform): improve runtime errors and warnings #11998
Conversation
@@ -250,6 +251,21 @@ class ScriptTransformer { | |||
} | |||
|
|||
async loadTransformers(): Promise<void> { | |||
const makeInvalidTransformerError = (transformPath: string) => |
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.
It could also live outside the class, of course. The class is huge, not so easy to decide.
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.
makes sense to move it outside rather than defining it inline 🙂
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.
Or even better to move it to separate file together with other runtime errors for this module. Had to think a bit, will do it later.
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.
that also works - as you say the class is huge and somewhat hard to grok/navigate
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.
👍
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
Resolves #11955
It would be useful to provide more information if a user is attempting to import an invalid transformer module. Current message does not specify modules name. Hence, it may be hard to identify the problem.
This PR is an attempt to improve the error message.
Test plan
Updated the existing tests.