easy_mock_http 0.2.3
easy_mock_http: ^0.2.3 copied to clipboard
Transport-agnostic HTTP mocking for Flutter VM tests. Intercepts dart:io's HttpClient via HttpOverrides, so Dio, http, or any client is mocked with zero injection — stub with when, assert with verify.
0.2.3 #
- Remove the deprecated
MockResult.verificationcompatibility alias.
0.2.2 #
- Make
MockResultextendLazyVerification, allowing direct assertions such asresult.calledOnce,result.never, andresult.calls. - Keep
MockResult.verificationas a deprecated compatibility alias.
0.2.1 #
- Make
MockResult.verificationcount every recorded request matching the registration's method, URL, body, headers, and query, including requests served by another registration with the same matcher.
0.2.0 #
- Replace
StubBuilderwithMockResult, returned directly by everywhen/expectverb.MockResult.verificationlazily verifies calls handled by that exact registration. - Preserve dynamic replies through the new
respondernamed argument. - Keep
mockHttp.verifyas the independent matcher-based verification API.
0.1.0 #
- Initial release:
mockHttp()with fluentwhen/expect/verifyverbs. - Intercepts
dart:ioHttpClientviaHttpOverrides— covers Dio,package:http, and any other VM transport with zero injection. - Request matching by method, URL (path, full URL, or RegExp), and subset
matchers for
body,headers, andquery(values may be flutter_test matchers). - Replies via
response/statusCode/responseHeaders, plusdelayfor slow responses anderrorfor transport failures;replyWithfor dynamic replies. - Records every request (
requests) and verifies sends withcalled/calledOnce/never.