-
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
[Bug]: Jest snapshots feature is broken with Angular 15.2.2 #2003
Comments
That export was removed recently in this PR: angular/angular#49296 I'm not sure what the meaning is behind their use of "theta" as a prefix for the export. Is that a Google convention? |
Indeed we observed our CI also failed in #2001 The theta is an Angular thing when they made the Ivy compiler. The original PR for Ivy compatibility is here #366 This preset is still supporting Angular versions which contain VE so I think we should create a separate serializer which doesn’t use that |
Is there any way to fix this temporary locally until new serializer is added? I wonder could this library do something similar as help-me-mom/ng-mocks#5126 ? That does not seem to be breaking change and keeps non-ivy / ivy support? |
As long as there is an alternative way to detect Ivy mode, it should be ok. PR is welcome. |
What would be the solution the to make snapshots works? is there any flag for the ivy related thing for Angular 15? |
Ok so the solution was to update to jest-preset-angular 13.0.1 based on the issue on angular-builders. And also Jest. Running
And after that the snapshots started working |
- updates typscript to v4.8.4 - updates all @angular*/* libs to v15 - updates @ngrx/* to v15 - updates jest to v29 - updates jest-preset-angular to v13 Jest update was required because the test snapshot feature was broken, [see](thymikee/jest-preset-angular#2003) supported browserlist was reduced: - kaios 2.5 was removed - op_mini all was removed ticket: #725 Change-Id: I654cbe1a855a09d00e4c5ed7beadfcb3b25148d4
Version
13.0.0-next.1
Steps to reproduce
Attempt to create a snapshot on a very simple component: (AppComponent here, for example)
The test errors out because the latest @angular/core at 15.2.2 no longer exports
ɵivyEnabled
:( as the serializer is expecting here and as a result, the else block here incorrectly gets hit, causing the undefined error.Expected behavior
Expect snapshots to be taken / tested against.
Actual behavior
Test failing on undefined errors.
Additional context
Perhaps we might want to do away with the "is Ivy check?" altogether, and just make the latest preset only compatible with Ivy (and eliminate the else condition)? (Alternatives: read in the version property from angular/core to do the isIvy check)
Environment
Windows 11 (I'm away from work computer at the moment)
The text was updated successfully, but these errors were encountered: