elixir-tesla / tesla

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

Improve Mock module to work properly with Timeout middleware #668

Closed carrascoacd closed 7 months ago

carrascoacd commented 7 months ago

Context

Using global mocks is not encouraged but, otherwise, is hard to mock clients that use the timeout middleware. Former issue.

Solution

This change tries to find the parent with the mocked fun if exists to avoid this from happening.

cc/ @yordis @teamon 😀