Skip to content
/ go-vcr Public

A Go library for recording/replaying HTTP calls during testing, inspired by VCR.

License

Notifications You must be signed in to change notification settings

ozeias/go-vcr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

go-vcr

The initial release provides the interface and implementation to record your test suite's HTTP interactions and replay them during future test runs for fast, deterministic, accurate tests.

Usage

import "github.com/ozeias/go-vcr/vcr"
...
server, httpClient := vcr.UseCassette("vine")
client.HTTPClient = httpClient
defer server.Close()

vine, err := client.getVine(vineID)
// ...

Once you run this test, go-vcr will record the HTTP request to fixtures/vine.json. When you run it again, go-vcr will replay the response. Works just like VCR.

About

A Go library for recording/replaying HTTP calls during testing, inspired by VCR.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages