Skip to content

Make the ComponentFixture public in new RouterTestingHarness #48855

@jnizet

Description

@jnizet

Which @angular/* package(s) are relevant/related to the feature request?

No response

Description

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.

Proposed solution

Expose the ComponentFixture publicly in RouterTestingHarness

Alternatives considered

  • cheat and access the property even though it's private, but that is of course not desirable.
  • reimplement the same kind of harness, but with a public component fixture. That is also not very desirable.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions