vcr 0.1.2

Flutter Android iOS

A package to mock requests in tests, storing request in json files and reusing

vcr #

A package to mock requests using Dio Client

Build Status

Getting Started #

To start using, just create a adapter and put inside your client
This is a example with Dio client:

VcrAdapter adapter = VcrAdapter();
Dio client = Dio();
client.httpClientAdapter = adapter;

After config the adapter, you now can use a cassette

adapter.useCassette('github/user_repos');

Response response = await client.get('https://api.github.com/users/keviinlouis/repos');
expect(response.statusCode, 200);

Now the request is stored in test/cassette/github/user_repos.json

If you have multiple requests for one test, they will be added in a list of requests If de adapter can't find the right request, he will make a normal request and then store the request

This package is inspired by VCR gem

Next Features

  • [ ] Work with Http Package
2
likes
80
pub points
14%
popularity

A package to mock requests in tests, storing request in json files and reusing

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

keviinlouiis@gmail.com

License

unknown (LICENSE)

Dependencies

dio, flutter, mockito

More

Packages that depend on vcr