tests/testthat/_snaps/serializer.md

useful error if not registered

Code
  serializer_fetch("foo")
Condition
  Error in `serializer_fetch()`:
  ! Unsupported cassette serializer "foo".

generates expected json

Code
  writeLines(readLines(ser$path))
Output
  {
    "http_interactions": [
      {
        "request": {
          "method": "GET",
          "uri": "http://example.com/"
        },
        "response": {
          "status": 200,
          "headers": {
            "name": "val"
          },
          "body": {
            "string": "body"
          }
        },
        "recorded_at": "2024-01-01 12:00:00"
      }
    ],
    "recorded_with": "VCR-<package_versions>"
  }

generates expected yaml

Code
  writeLines(readLines(ser$path))
Output
  http_interactions:
  - request:
      method: GET
      uri: http://example.com/
    response:
      status: 200
      headers:
        name: val
      body:
        string: body
    recorded_at: 2024-01-01 12:00:00
  recorded_with: VCR-<package_versions>


Try the vcr package in your browser

Any scripts or data that you put into this service are public.

vcr documentation built on Aug. 8, 2025, 6:45 p.m.