Closed
Description
We would like to be able to inject a client into the http package (e.g. the MockClient obtained from http/testing) such that the top-level methods such as "get" and "head" and so forth will use the mock client instead of a brand new Client.
We had previously implemented this by forking http
and changing it as follows:
https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/http/client.dart#L32
We would like to just use the http
package directly now, but without this way to inject a MockClient, we have the problem that anyone using the convenience methods like http.get()
will end up doing actual network traffic in our tests instead of hitting our mock.
Metadata
Metadata
Assignees
Labels
No labels