elixir-tesla / tesla

The flexible HTTP client library for Elixir, with support for middleware and multiple adapters.
MIT License
2.01k stars 348 forks source link

Introduce assert_receive_tesla_call #724

Open visciang opened 1 month ago

visciang commented 1 month ago

Hi!

May I ask you if it's possible to introduce a Tesla.Test.assert_receive_tesla_call() along the line of Test.Test.assert_received_tesla_call().

I have some asynchronous code I'm test an it would be nice to assert_receive instead of just assert_received.

Maybe it could have also an additional optional timeout option to be passed to the underlying assert_receive.

yordis commented 1 month ago

PR welcome; I kept it minimal based on immediate needs! Please let me know if you are capable to contribute, I can help you with it; otherwise, I will get to this eventually, trying to clean up as much as I can at the moment

visciang commented 1 month ago

PR welcome; I kept it minimal based on immediate needs! Please let me know if you are capable to contribute, I can help you with it; otherwise, I will get to this eventually, trying to clean up as much as I can at the moment

Perfect! I'll open a PR shortly, feel free to adjust as you like

visciang commented 1 month ago

FYI: https://github.com/elixir-tesla/tesla/pull/725