I am trying to setup testing using the store for one of my components and it seems that the provideMockStore function is not actually providing the MockStore. I have to also include MockStore in my providers.
I am unsure if this is expected (as the docs do not show this) or if I am implementing testing incorrectly.
The error I am getting is this:
Failed: R3InjectorError(CompilerModule)[MockStore -> MockStore]:
NullInjectorError: No provider for MockStore!
However, if I add MockStore to the providers array, it works fine.
...
TestBed.configureTestingModule({
declarations: [
LoginPage
],
providers: [
MockStore,
provideMockStore()
]
});
...
[X] Yes (Assistance is provided if you need help submitting a pull request)
[ ] No
Hi, what version of NgRx are you using?
This should be fixed in NgRx v9.
You're right, thank you. Closing!
Most helpful comment
Hi, what version of NgRx are you using?
This should be fixed in NgRx v9.