-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
RFC: mock selectors in MockStoreConfig #1827
Comments
Good idea, I'm assigning this issue to you for tracking. |
Sounds good, I'll pick it up. |
@brandonroberts do you know why the example-app test files are being compiled and tested with jest using a typescript version < 3.4? I'm trying out using a typescript 3.4+ feature for enforcing the mock value type matches the selector type. |
Not sure. Do you have TypeScript globally installed? From running |
@brandonroberts I decided against type checking the selector return type against the mock value type due to the added complexity and lack of clarity in expected type it provided the developer. If you're curious, I can explain more. |
Is there a working example of this? The ngrx overrideSelector stackblitz isn't working for multiple overrides in a single component. Any help is great thanks. |
Yes, checkout the example app included in this repository. The unit tests mostly use this setup. |
I'd like to open a pull request to add a mock selectors option to the
MockStoreConfig
. This will enable developers to mock selectors up front in the testing module configuration, similar to how you can provide an initial state.This enables developers who do not need to update the state or selector to omit creating a
MockStore
instance.Current example
Future example
Proposed solution
Since it would add an extra optional configuration property, this would not introduce a breaking change.
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
The text was updated successfully, but these errors were encountered: