Skip to content

Unit tests failing with the error - No provider for InjectionToken HotkeyOptions #181

Description

@planck4

My unit tests are failing for the components where I'm using the HotkeysService with this error -
NullInjectorError: R3InjectorError(DynamicTestModule)[HotkeysService -> InjectionToken HotkeyOptions -> InjectionToken HotkeyOptions]: NullInjectorError: No provider for InjectionToken HotkeyOptions
Any ideas how to fix? I tried importing the HotkeyModule in the tests to no avail

I'm using v2.2.0 with Angular 9.1.6

Update: It worked when I imported HotkeyModule.forRoot() in the unit tests. Is this the right way?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions