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

Add mocking selectors to MockStore #1504

Closed
nasreddineskandrani opened this issue Jan 6, 2019 · 0 comments · Fixed by #1688
Closed

Add mocking selectors to MockStore #1504

nasreddineskandrani opened this issue Jan 6, 2019 · 0 comments · Fixed by #1688
Assignees

Comments

@nasreddineskandrani
Copy link
Contributor

nasreddineskandrani commented Jan 6, 2019

Following my comment here

I'll open one or multiple PR(s) to update the example-app with MockStore as stated in these comments
#1027 (comment)
I start working on it tomorow.

I added a first component spec update for the example-app in this fork commit.
Based on the current MockStore version and after experiencing it, i can say surely:
the brain time to resolve the mocked state vs just the state needed in the selector is bigger which is a waste of time (especially when you test your selectors independently)

what i did in the commit on top
=> comeback to a simpler case of @maxime1992 comment here

@brandonroberts
i really recommend before updating the doc and the example-app to move forward [now] with your proposal to mock selectors here.

So we can document the MockStore separately in the ngrx doc with the 2 possible methods of mocking and we can use the efficient one for unit testing in the example-app which is the mock selectors.

Note:
A dev asked for it recently
#915 (comment)

If accepted, I would be willing to submit a PR for this feature

[X] Yes (Assistance is provided if you need help submitting a pull request)
[ ] No

I am motivated if you are busy to use your proposal and play with it to make sure it cover all cases... and submit a PR before proceeding with the example-app update.

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

Successfully merging a pull request may close this issue.

3 participants