-
Notifications
You must be signed in to change notification settings - Fork 10
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
Complexity in testing #3
Comments
@sergeykifyak @machadogj I suppose you could return Promise.reject(err) there instead? It'd have the same result in the promise chain, right? |
Hi @sergeykifyak thanks for bringing this up. Can you describe the complexity you are having? I've been meaning to makes testing of actions easier myself, but I am wondering which complexities this change would fix. @sbussetti notice that the throw is happening in a
|
Yup, I am assuming @sergeykifyak is directly testing the function outside of a promise, and having trouble catching the thrown exception which is why I suggested the equivalent return of a rejection. Anywho, just being helpful =) |
@sbussetti well... without a promise, you are right, it's throwing outside of the For example, this action will return a promise:
because
I did it this way so that it could support |
@machadogj yeah really good points. Curious to get more details on how @sergeykifyak is constructing their tests. |
I was to fast when I was opening the issue. My apologies for that.
api.js
I decided to move all unsuccessful requests into '_FAILED' because it is easer to decouple in reducers, like this:
reducerUnsuccessful.js
Now we can talk about complexity of testing,
Give me know if you will need more info. |
Hey guys,
I would like to purpose to you to remove this line, because it adds complexity while testing.
redux-thunk-actions/src/index.js
Line 40 in cb5933d
The text was updated successfully, but these errors were encountered: