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
targeting my app to es2020 causes unexpected failures #6863
Comments
Thank you for submitting this issue. We would love to assist you and diagnose it. However, we need a simple sample that we can easily run on our side in order to replicate the issue and research its cause. Without a sample, we are not able to figure out what's going on and why this issue occurs. Refer to this article to create the best example: How To: Create a Minimal Working Example When You Submit an Issue. We look forward to your response. |
Thank you for submitting this issue. Since you are using an outdated version of TestCafe, we recommend you update TestCafe to the latest version to check if this issue has been addressed. We constantly improve our tools, and there is a chance that this issue has been already resolved and/or is no longer reproducible in the latest version. We look forward to your response. |
@aleks-pro
And instead of running via the builder I started the app locally and ran as follows:
But when tried to find the app.ts code in the browser to see if it was modified, there was no app.ts only the Angular compiled js, I'll open a mirroring issue to the testcafe-hammerhead repo as well |
Actually this issue seems related --> DevExpress/testcafe-hammerhead#2714 |
Hi @LironHazan You are right. This issue is a duplicate of the following one: DevExpress/testcafe-hammerhead#2714. |
Hi guys! |
Hi @AlexanderZhig, See the future updates related to this issue at #6995. |
@miherlosev it seems that Optional Chaining is not supported yet :( |
Hi @JSteunou, As far as I understand, you created a new issue for your case. Let us continue our conversation in this new issue. |
What is your Scenario?
I need to target my Angular typescript app to es2020, till recently I was targeting to es2015 (tsconfig).
Somewhere in my code there's the following line which uses optional chaining to guard from nullish/undefined cases:
localStorageData?.[columnDefItem.field]
When running my tests in an es2015 , Chrome 98.0.4758.80 the code shipped to the browser was transformed into:
if (localStorageData === null || localStorageData === void 0 ? void 0 : __get$(localStorageData,columnDefItem.field) )
But when running into es2020, chrome 98.0.4758.80, the guard was removed:
if ( __get$(localStorageData,columnDefItem.field) )
The full stacktrace:
Does the hammerhead.js responsible for the code instrumentation?
Is there a workaround I can use at the momet?
The testcafe version is 1.18.1
Appreciate any help!!
What is the Current behavior?
Code was transformed into:
if ( __get$(localStorageData,columnDefItem.field) )
What is the Expected behavior?
Proper transform:
if (localStorageData === null || localStorageData === void 0 ? void 0 : __get$(localStorageData,columnDefItem.field) )
What is your public website URL? (or attach your complete example)
The repo is private.
What is your TestCafe test code?
no need.
Your complete configuration file
No response
Your complete test report
No response
Screenshots
No response
Steps to Reproduce
TestCafe version
1.18.1
Node.js version
16.10
Command-line arguments
./node_modules/.bin/testcafe 'chrome --incognito' e2e/tests/roles/happy-flows.e2e-spec.ts --compiler-options typescript.customCompilerModulePath=../typescript --debug-on-fail
Browser name(s) and version(s)
Chrome 98.0.4758.80
Platform(s) and version(s)
macOS 10.15.7
Other
Thanks!
The text was updated successfully, but these errors were encountered: