-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Test store dependency binding #1620
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
Conversation
reducer: Reducer, | ||
updateDependencies: (inout DependencyValues) -> Void = { _ in }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this'll be a trailing closure without argument labels most of the time, but what do you think of:
updateDependencies: (inout DependencyValues) -> Void = { _ in }, | |
prepareDependencies: (inout DependencyValues) -> Void = { _ in }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep that works for me. will update
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good changes!
Love it, thanks!! |
I just realized |
@crayment That should be the case by virtue of the fact that we updated the private function We probably should update the test to get coverage on this fact though. |
I haven't verified on this branch yet. Still using my helpers. If you give me a bit I can verify, and maybe even PR an update to the test 😄 |
I did just verify locally with a test and it seems OK. But yes please feel free to PR a test to get coverage. |
Done: #1644 Feel free to just close if you like your test updates better though! |
This makes it so that the test context is set when constructing the
TestStore
and in the modify closures ofsend
/receive
, and provides a trailing closure initializer forTestStore
for customizing dependencies.This idea came from @crayment in #1613.