A package to mock requests using Dio Client
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
[0.1.2] - 17 december 2019.
Fixes on directory relativity
[0.1.0] - 17 december 2019.
The first release
A new Flutter project.
Getting Started #
This project is a starting point for a Flutter application.
A few resources to get you started if this is your first Flutter project:
For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.
Use this package as a library
1. Depend on it
Add this to your package's pubspec.yaml file:
dependencies: vcr: ^0.1.2
2. Install it
You can install packages from the command line:
$ flutter pub get
Alternatively, your editor might support
flutter pub get.
Check the docs for your editor to learn more.
3. Import it
Now in your Dart code, you can use:
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
We analyzed this package on Jan 16, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
- Dart: 2.7.0
- pana: 0.13.4
- Flutter: 1.12.13+hotfix.5
Health issues and suggestions
Document public APIs. (-1 points)
11 out of 11 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.
flutter format to format
|Dart SDK||>=2.1.0 <3.0.0|