Skip to content
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

Hammerhead transformations break ng19 build output #3035

Open
soletan opened this issue Jan 14, 2025 · 2 comments
Open

Hammerhead transformations break ng19 build output #3035

soletan opened this issue Jan 14, 2025 · 2 comments

Comments

@soletan
Copy link

soletan commented Jan 14, 2025

What is your Scenario?

We are testing a web application's build with TestCafe in a local browser like Edge. The application has been based on Angular 17 recently. Everything was working well there. Currently we are trying to upgrade to Angular 19.

What is the Current behavior?

After upgrading to Angular 19, all TestCafe-based tests fail for the application fails to load in any test scenario.

Analysis has found that Hammerhead is transforming occurrences of location into __get$Loc(location) and it is failing to recognize certain cases in which that replacement is breaking the code.

  • This is part of code built by ng19:
    grafik

  • The highlighted part gets replaced by hammerhead:
    grafik

  • The causing code is here:
    grafik

  • The transformation fails to recognize location being declared as instance property of that class. The code in question is part of Angular, thus there is no way that we could work around this issue on our end:
    grafik

What is the Expected behavior?

  • Hammerhead should be aware of property declarations in classes when transforming code on the fly.
  • The application should load.

What is your public website URL? (or attach your complete example)

closed source ... must not share

What is your TestCafe test code?

does not apply here

Your complete configuration file

No response

Your complete test report

No response

Screenshots

No response

Steps to Reproduce

  1. build application with ng19
  2. try testing it with testcafe

TestCafe version

3.7.1

Node.js version

22.11.0

Command-line arguments

testcafe is run through gherkin-testcafe

Browser name(s) and version(s)

No response

Platform(s) and version(s)

Windows 11

Other

typescript 5.4.5

Copy link

Thank you for submitting a bug report. We would love to help you investigate the issue. Please share a simple code example that reliably reproduces the bug. For more information, read the following article: How To Create a Minimal Working Example When You Submit an Issue. We look forward to your response.

@soletan
Copy link
Author

soletan commented Jan 15, 2025

I've created a vanilla ng19 project with TestCafe set up for doing a very simple test here:

https://github.com/soletan/testcafe-ng19-example

  • npm i
  • npm run build
  • npm run e2e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants