easy_mock_http 0.3.0
easy_mock_http: ^0.3.0 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.
Use this package as a library
Depend on it
Run this command:
With Dart:
$ dart pub add easy_mock_httpWith Flutter:
$ flutter pub add easy_mock_httpThis will add a line like this to your package's pubspec.yaml (and run an implicit dart pub get):
dependencies:
easy_mock_http: ^0.3.0Alternatively, your editor might support dart pub get or flutter pub get. Check the docs for your editor to learn more.
Import it
Now in your Dart code, you can use:
import 'package:easy_mock_http/easy_mock_http.dart';