angular 14 Uncaught SyntaxError: cannot use `??` unparenthesized within `||` and `&&` expressions
jlabaj opened this issue · 5 comments
What is your Scenario?
when running in angular 14 we get SyntaxError: cannot use ??
unparenthesized within ||
and &&
expressions
What is the Current behavior?
all test fail because of this error in hammerhead
What is the Expected behavior?
no error
What is your public website URL? (or attach your complete example)
cant share
What is your TestCafe test code?
fixture board tests
.page(E2eConstants.URL)
.beforeEach(async (t) => {
await t
.maximizeWindow() --> fails here
.useRole(roles.testUser)
await NavigationBL.navigateFromLoginToOverview();
})
Your complete configuration file
No response
Your complete test report
No response
Screenshots
No response
Steps to Reproduce
TestCafe version
1.19.0
Node.js version
16.15.1
Command-line arguments
set TESTCAFE_ENV=https://localhost:4200/ && testcafe chrome ./e2e/src/tests
Browser name(s) and version(s)
102.0 (64-bit), chrome 103.0.5060.66 (Official Build) (64-bit)
Platform(s) and version(s)
No response
Other
No response
Hi @jlabaj,
I didn't manage to reproduce the issue and didn't get any errors in the test including the maximizeWindow
step. Please share a minimal working example based on the following instructions: https://testcafe.io/402636/faq#how-to-create-a-minimal-working-example-when-you-submit-an-issue.
hi @Aleksey28 here is a minimal working example:
https://github.com/jlabaj/angular-ivy-prghjg
https://stackblitz.com/edit/angular-ivy-prghjg
after 'npm i', please run 'npm run e2e:localprodconf'
you should see smg. like this:
I managed to isolate the problem to "devextreme-angular": "22.1.3" library.
I concluded if I import any module of this library in my app I get this error when testing.
In my example I used DxPopoverModule in app.module.ts
If you comment out this module the test passes.
Thank you for the example. I reproduced this issue. We are going to fix it in the scope of the following thread DevExpress/testcafe-hammerhead#2782
@Aleksey28 thank you. Also if I turn off the script optimization in angular.json the test is green.
"optimization": {
"scripts": false,
"styles": {
"minify": true,
"inlineCritical": false
},
"fonts": {
"inline": true
}
},
Thank you for the additional information. We are working on this issue. You can check its progress here: Script error during processing destruction with ?? operator #2782.