-
-
Notifications
You must be signed in to change notification settings - Fork 308
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
🐛 Removed source-map-support for ts-jest. #1562
🐛 Removed source-map-support for ts-jest. #1562
Conversation
Hi! Thanks! |
Hey @jBernavaPrah jovo-framework/jovo-core/src/index.ts Line 15 in 56a8ae4
Removing the install part would break stuff. But it will work if it is not used in Jest. Could you update your code? try {
// do not use source map support with jest.
if (process.env.JEST_WORKER_ID === undefined) {
// eslint-disable-next-line @typescript-eslint/no-var-requires
require('source-map-support').install();
}
} catch (error) {
Log.error(error);
} |
Thanks @aswetlow! I will do the change you suggested. I have a concern regarding the try-catch. Mainly 3 reasons:
What do you think or what I'm missing here? |
Sorry, I did a simple copy&paste from the old version. I can't remember why we added the try/catch block, but I think it failed in some environments. It may not be relevant anymore since we didn't have issues with it in v4. It's a simple error logging in the catch block because it was okay to fail silently. You can remove the try/catch block. if (process.env.JEST_WORKER_ID === undefined) {
// eslint-disable-next-line @typescript-eslint/no-var-requires
require('source-map-support').install();
} Thank you for questioning my suggestion. |
Fix done! :) Thanks for explaining it @aswetlow! |
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.
Thank you @jBernavaPrah! 🎉
Proposed Changes
Fix: #1561
Types of Changes
Checklist