Angular 21
Update to update 21
By no means an extensive evaluation, but in my attempt to use it with v21, the main issue I'm hitting is Uncaught Error: NG0101: ApplicationRef.tick is called recursively thrown, and mainly when providing keyboard input.
Some debugging shows it's coming from waitForWrapper: https://github.com/testing-library/angular-testing-library/blob/d4d45679a1cc4176439b1f4946dae55ae7c0bd98/projects/testing-library/src/lib/testing-library.ts#L592
I'm still on zoned change detection (using provideZoneChangeDetection()).
I didn't encounter any issue with tick, probably because the application is zoneless.
A minor change that I am noticing with respect to routing is that the render promise of components with routes now resolves before an initial redirect completes.
Interesting finding with the new vitest which is default in Angular v21 is how configureTestingModule works with non-standalone components: https://github.com/angular/angular/issues/66007 https://github.com/angular/angular/issues/65665
It means that the current implementation of WrapperComponent for inline-template tests won't work as expected since it's not a standalone component.
Probably we should think about migrating this to standalone with this update.
Interesting finding with the new vitest which is default in Angular v21 is how
configureTestingModuleworks with non-standalone components: angular/angular#66007 angular/angular#65665It means that the current implementation of
WrapperComponentfor inline-template tests won't work as expected since it's not a standalone component.Probably we should think about migrating this to standalone with this update.
Yea, I agree. This should become the default in v21.
I'm working on a new release, feel free to try it out as @testing-library/angular@beta and provide some feedback here.
If you encounter any issues, please provide a reproduction - or a test case in this repo on the beta branch.
More info can be found at https://github.com/testing-library/angular-testing-library/releases or https://github.com/testing-library/angular-testing-library/pull/559
By no means an extensive evaluation, but in my attempt to use it with v21, the main issue I'm hitting is
Uncaught Error: NG0101: ApplicationRef.tick is called recursively thrown, and mainly when providing keyboard input.Some debugging shows it's coming from
waitForWrapper:angular-testing-library/projects/testing-library/src/lib/testing-library.ts
Line 592 in d4d4567
tick(0); I'm still on zoned change detection (using
provideZoneChangeDetection()).
@rdamazio I'm unable to reproduce this, can you provide an example please?
Interesting finding with the new vitest which is default in Angular v21 is how
configureTestingModuleworks with non-standalone components: angular/angular#66007 angular/angular#65665It means that the current implementation of
WrapperComponentfor inline-template tests won't work as expected since it's not a standalone component.Probably we should think about migrating this to standalone with this update.
@dzonatan can you provide an example please? I'm not encountering any issues with declaring the wrapping component as standalone: false. Funny enough I do get errors when I change this to true.