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
Async Actions — Unit Testing #20
Comments
mxstbr
added a commit
that referenced
this issue
Dec 17, 2015
Fix unit tests by exposing the non-async actions too. Non-optimal solution, looking for a better one in #20
This issue might be worth reading through: reduxjs/redux-thunk#14 |
Using the rewire module seems like the right way to go, see here |
mxstbr
added a commit
that referenced
this issue
Dec 25, 2015
Using the rewire module, we now don't have to export our hidden non-async actions to test them, we can get them using rewire. Makes for a much less error-prone application writing, it's a bit more overhead for the unit tests writing, thoughI think that's worth it. Also see https://stackoverflow.com/questions/14874208/how-to-access-and-test-an-internal-non-exports-function-in-a-node-js-module Closes #20
Done with 417362f! |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Since testing async actions isn't really useful, you have to export the non-async actions too to test them. This results in functions being exposed that shouldn't be. Example:
changeOwnerName
andchangeProjectName
shouldn't really be accessible from the outside, which they are right now so the unit tests can import them.The text was updated successfully, but these errors were encountered: