vcr 0.1.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 51

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

[0.1.2] - 17 december 2019.

Fixes on directory relativity

[0.1.0] - 17 december 2019.

The first release

example/README.md

example #

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:

with Flutter:


$ 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:


import 'package:vcr/vcr.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
2
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
51
Learn more about scoring.

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.

Format lib/vcr.dart.

Run flutter format to format lib/vcr.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
dio ^3.0.4 3.0.8
flutter 0.0.0
mockito ^4.1.1 4.1.1
Transitive dependencies
async 2.4.0
boolean_selector 1.0.5
charcode 1.1.2
collection 1.14.11 1.14.12
http_parser 3.1.3
matcher 0.12.6
meta 1.1.8
path 1.6.4
sky_engine 0.0.99
source_span 1.6.0
stack_trace 1.9.3
stream_channel 2.0.0
string_scanner 1.0.5
term_glyph 1.1.0
test_api 0.2.12
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test