No response
The RouterTestingHarness which just landed in the main branch looks great, but if I understand correctly, it creates a ComponentFixture and keeps it private.
This makes it impossible to use some of the methods/properties that ComponentFixture exposes in tests using the RouterTestingHarness.
And this also makes it harder to use existing testing libraries which are built on top of ComponentFixture, such as ngx-speculoos.
It would be nice if the RouterTestingHarness exposed the root ComponentFixture publicly instead of keeping it private.
Expose the ComponentFixture publicly in RouterTestingHarness
Thanks for the feedback. ComponentFixture
was initially exposed but got removed after some rounds of public API review.
This makes it impossible to use some of the methods/properties that ComponentFixture exposes in tests using the RouterTestingHarness.
Could you expand on this a bit? Which methods/properties, specifically? We felt that what was exposed would satisfy the necessary use-cases. Most of the helper methods not exposed from ComponentFixture
are just wrappers around things you can already do with public API. Granted, if you wanted those specific features, it'd be a lot more verbose to rewrite them by hand, but I'd be curious about the specific use-cases. I would guess this comes down more to integrating with existing tooling written around ComponentFixture
interface/instance.
And this also makes it harder to use existing testing libraries which are built on top of ComponentFixture, such as ngx-speculoos.
What's exposed in the harness would be enough to technically work with ngx-speculoos, but I agree that this isn't a good answer. ComponentFixture
seems the best way to be compatible with community tooling, including test harnesses from the CDK. Those harnesses use componentRef and whenStable from the fixture, which aren't exposed in the router testing harness.
// cc @alxhub
Owner Name | angular |
Repo Name | angular |
Full Name | angular/angular |
Language | TypeScript |
Created Date | 2014-09-18 |
Updated Date | 2023-03-21 |
Star Count | 87006 |
Watcher Count | 3028 |
Fork Count | 23170 |
Issue Count | 1418 |
Issue Title | Created Date | Updated Date |
---|