{"id":32275771,"url":"https://github.com/louis-kevin/vcr","last_synced_at":"2025-10-22T23:54:47.972Z","repository":{"id":48803866,"uuid":"228633522","full_name":"louis-kevin/vcr","owner":"louis-kevin","description":"A dart VCR ","archived":false,"fork":false,"pushed_at":"2023-05-15T07:03:06.000Z","size":140,"stargazers_count":9,"open_issues_count":4,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-22T23:54:40.788Z","etag":null,"topics":["client","dart","dio","flutter","flutter-package","mock","tests","vcr"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/vcr","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/louis-kevin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-17T14:24:25.000Z","updated_at":"2023-05-13T19:47:04.000Z","dependencies_parsed_at":"2024-11-16T03:26:17.086Z","dependency_job_id":"b4cd7da8-6ca3-41b8-9e1a-023d01ea43e7","html_url":"https://github.com/louis-kevin/vcr","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/louis-kevin/vcr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/louis-kevin%2Fvcr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/louis-kevin%2Fvcr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/louis-kevin%2Fvcr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/louis-kevin%2Fvcr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/louis-kevin","download_url":"https://codeload.github.com/louis-kevin/vcr/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/louis-kevin%2Fvcr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280534673,"owners_count":26346714,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-22T02:00:06.515Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["client","dart","dio","flutter","flutter-package","mock","tests","vcr"],"created_at":"2025-10-22T23:54:46.480Z","updated_at":"2025-10-22T23:54:47.962Z","avatar_url":"https://github.com/louis-kevin.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vcr\n\nA package to mock requests using Dio Client\n\n![tests](https://github.com/louis-kevin/vcr/actions/workflows/tests.yaml/badge.svg)\n\u003ca href=\"https://codeclimate.com/github/keviinlouis/vcr/maintainability\"\u003e\u003cimg src=\"https://api.codeclimate.com/v1/badges/2b4874898ddb47ca3c76/maintainability\" /\u003e\u003c/a\u003e\n## Getting Started\n\nTo start using, just create a adapter and put inside your client\u003cbr\u003e\nThis is a example with Dio client:\n```\nVcrAdapter adapter = VcrAdapter({basePath:'test/cassettes', createIfNotExists: true });\nDio client = Dio();\nclient.httpClientAdapter = adapter;\n```\n\nAfter config the adapter, you now can use a cassette\n\n```\nResponse response = await client.get('https://api.github.com/users/louis-kevin/repos');\nexpect(response.statusCode, 200);\n```\n\nNow the request is stored in `test/cassette/users/louis-kevin/repos.json`\u003cbr\u003e\n\nIf you have multiple requests for one test, they will be added in a list of requests\nIf the adapter can't find the right request, he will make a normal request and then store the request\n\nThis package is inspired by VCR gem\n\n#### Options\n\n| option            | type    | description                                                               | default        |\n|-------------------|---------|---------------------------------------------------------------------------|----------------|\n| basePath          | string  | Path to store your cassettes, relative to root                            | test/cassettes |\n| createIfNotExists | boolean | If this is disabled, you need to call  `useCassette` before call your api | true           |\n\n### Using useCassette\nThe only main difference is that you need to call `useCassette` before calling your API\n```\nadapter.useCassette('github/my_casssete')\nResponse response = await client.get('https://api.github.com/users/louis-kevin/repos');\nexpect(response.statusCode, 200);\n```\n\nYou can choose passing `.json` format or not, it will store the cassette in json either way\u003cbr\u003e\nNow the request is stored in `test/cassette/github/my_casssete.json`\u003cbr\u003e\n\n#### Next Features\n- [ ] Work with Http Package\n- [ ] Work with YAML\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flouis-kevin%2Fvcr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flouis-kevin%2Fvcr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flouis-kevin%2Fvcr/lists"}