talira

http_mock_adapter

Mock Dio HTTP requests in Dart and Flutter tests

open sourceMITfree

http_mock_adapter is a Dart package for mocking Dio HTTP calls in tests: you attach a DioAdapter and declare the responses each request should get, with matchers that can check the full request including an exact body.

Problems it solves

  • mock Dio HTTP requests in Flutter tests
  • unit test code that calls an API with Dio
  • fake API responses in Dart tests

Features

  • declarative request-response mocks for Dio
  • request matchers including exact body checks
  • test-only adapter