-
Notifications
You must be signed in to change notification settings - Fork 306
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
Jest 29 async await transform #2010
Comments
Hi @JiaLiPassion, in v13, we removed the hardcoded tsconfig to be below As long as users use target |
@ahnpnl , thank you, and I saw the new README to mention this change, in Should |
Ah ha thank you for the information. I think those babel plugins should be included in this preset then. |
@ahnpnl , Got it, thank you. |
Close angular#49110 From jest 29 and jest-preset-angular v13, the module transform logic changed, and now jest-preset-angular use the use the tsconfig target other than the hardcoded one, thymikee/jest-preset-angular#2010 But jest-angular-preset doesn't introduce the @babel/plugin-transform-async-to-generator which is needed by angular since `async/await` still need to be transformed to promise for ES2017+ target. So for now, we disable to output the uncaught error console log for a temp solution, until jest-preset-angular find a proper solution.
Close angular#49110 From jest 29 and jest-preset-angular v13, the module transform logic changed, and now jest-preset-angular use the use the tsconfig target other than the hardcoded one, thymikee/jest-preset-angular#2010 But jest-angular-preset doesn't introduce the @babel/plugin-transform-async-to-generator which is needed by angular since `async/await` still need to be transformed to promise for ES2017+ target. So for now, we disable to output the uncaught error console log for a temp solution, until jest-preset-angular find a proper solution.
@ahnpnl , I am trying the guide here https://thymikee.github.io/jest-preset-angular/docs/guides/using-with-babel
And it reports
When try to parse |
Close #49110 From jest 29 and jest-preset-angular v13, the module transform logic changed, and now jest-preset-angular use the use the tsconfig target other than the hardcoded one, thymikee/jest-preset-angular#2010 But jest-angular-preset doesn't introduce the @babel/plugin-transform-async-to-generator which is needed by angular since `async/await` still need to be transformed to promise for ES2017+ target. So for now, we disable to output the uncaught error console log for a temp solution, until jest-preset-angular find a proper solution. PR Close #49325
Hi I think the doc is outdated, you can check the proper configuration here https://github.com/thymikee/jest-preset-angular/tree/main/e2e/babel-support |
Yeah, I also tried that one, the same error occurs. it seems the e2e is not testing an angular app. |
I quickly made an example here #2036 If you are using |
Thanks, this one works! |
Please do not submit this issue.
Hi @ahnpnl
There is an issue in Angular side,
angular/angular#49110
And I would like to confirm in the Jest29 and jest-preset-angular 13+, the
async/await
will still be downgraded toPromise
, is that correct?Thank you.
The text was updated successfully, but these errors were encountered: