Skip to content

Latest commit

 

History

History
22 lines (15 loc) · 785 Bytes

1.testing.md

File metadata and controls

22 lines (15 loc) · 785 Bytes

Testing

There are two primary ways to mock requests in Tesla:

  • Using Mox
  • Using Tesla.Mock (deprecated)

You can also create a custom mock adapter if needed. For more information about adapters, refer to the Adapter Guide to create your own.

Should I Use Mox or Tesla.Mock?

We recommend using Mox for mocking requests in tests because it is well-established in the Elixir community and provides robust features for concurrent testing. While Tesla.Mock offers useful capabilities, it may be removed in future releases. Consider using Mox to ensure long-term compatibility. For additional context, see GitHub Issue #241.

References