Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
rajatkhare619 opened this issue Jan 29, 2024 · 0 comments

Comments

@rajatkhare619
Copy link

rajatkhare619 commented Jan 29, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant