Skip to content
This repository has been archived by the owner on Jan 10, 2018. It is now read-only.

Component with NGRX Dependency Unit Test Issue in Karma #449

Closed
lkyashu opened this issue Jul 23, 2017 · 1 comment
Closed

Component with NGRX Dependency Unit Test Issue in Karma #449

lkyashu opened this issue Jul 23, 2017 · 1 comment

Comments

@lkyashu
Copy link

lkyashu commented Jul 23, 2017

While writing unit test for a component which depends on NGRX/Store for some value, i am getting an error saying value is undefined. However same is working fine when i am running the application. The angular app uses Webpack with AOT so don't know if that has something to do with it. I created a sample app and every thing seems to work fine in that. Unit test is successful. However in that Webpack with AOT application, it doesn't seem to work.

See the question on stackoverflow. I don't know whether i need to create a mock store or not, because simply adding the storemodule and adding the service in providers in spec.ts is not doing the needful. The same is working though in a sample app.

https://stackoverflow.com/questions/45253136/creating-a-mockstore-class-to-mock-ngrx-store-to-test-components-with-ngrx-store

@jotatoledo
Copy link

please use the issue tracker of @ngrx/platform

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

No branches or pull requests

3 participants