Skip to content

currentNavigation() not working in unit tests with createRoutingFactory from Spectator #738

@paweell5808

Description

@paweell5808

Is this a regression?

No

Description

The Angular documentation recommends using currentNavigation() instead of getCurrentNavigation(), but when using createRoutingFactory from Spectator in unit tests, calling this.router.currentNavigation results in the following error:

this.router.currentNavigation is not a function

Expected behavior
currentNavigation() should be available and mockable in unit tests, just like other router properties and methods.

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

this.router.currentNavigation is not a function

Please provide the environment you discovered this bug in

Angular 20.3.2, ngneat/spectator 22.1.0, jest 29.7.0

Anything else?

No response

Do you want to create a pull request?

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions