vcr 0.1.2 copy "vcr: ^0.1.2" to clipboard
vcr: ^0.1.2 copied to clipboard

outdated

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
3
likes
0
pub points
26%
popularity

Publisher

unverified uploader

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

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

dio, flutter, mockito

More

Packages that depend on vcr