You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been looking online for some guidance on how to test code that is calling an instance of Axios rather than just something like axios.post(...), and am really at a loss. I've been using this library, which is fantastic, but am really stuck here and feel like I might be missing something. An example of the code I'm trying to test could look like this:
My impulse to test code like this would be to mock the return value of axios.create, is that necessary? Is there something in this library that I'm missing that would be useful there? Thanks very much for your time, and my apologies if this isn't the best place to ask for advice on this. I should also note that I'm working with TypeScript if that's helpful.
The text was updated successfully, but these errors were encountered:
sorry for the late response and thanks for raising the issue. As @ryanrhee already mentioned, this is already being "discussed" (well, it is a bit stale right now) in #59. Thus, I will close this issue and try to revive the other thanks.
Hi everyone,
I've been looking online for some guidance on how to test code that is calling an instance of Axios rather than just something like
axios.post(...)
, and am really at a loss. I've been using this library, which is fantastic, but am really stuck here and feel like I might be missing something. An example of the code I'm trying to test could look like this:My impulse to test code like this would be to mock the return value of
axios.create
, is that necessary? Is there something in this library that I'm missing that would be useful there? Thanks very much for your time, and my apologies if this isn't the best place to ask for advice on this. I should also note that I'm working with TypeScript if that's helpful.The text was updated successfully, but these errors were encountered: