Replies: 3 comments 6 replies
-
Hi @bux225, this code isn't very testable because you are reaching out into the real world to make a network request (the line where you do |
Beta Was this translation helpful? Give feedback.
-
OK, I've read and coded the example of numbersapi behind a dependency and the testing. I still think I have a very naive question but the test doesn't seem to do anything at all. I can change the url even and the test passes since it's not even testing the call. Why is this desired? I'd like to ensure that I could do the following tests on my actual API in my app:
|
Beta Was this translation helpful? Give feedback.
-
Will do. The OP was about multiple effects. In this case it is the URLResponse status code as well as the data payload itself from an API call. But I'll reframe into a new discussion |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm doing a standard parse of an API cal for both the status code (for error UX) and for the response. The below works but I have no idea if it's the right/best way to do this. I'm having a difficult time writing tests against it. Specifically, the two outputs at the end
In Reducer:
` case .authenticate:
Beta Was this translation helpful? Give feedback.
All reactions