Roger-luo / BrokenRecord.jl

Reproducible tests for HTTP requests

Home Page:https://juliatesting.github.io/BrokenRecord.jl

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BrokenRecord

Docs Build Status

A VCR clone in Julia.

Record your test suite's HTTP interactions and replay them during future test runs for fast, deterministic, accurate tests.

julia> using BrokenRecord: configure!, playback

julia> using HTTP

julia> dir = mktempdir();

julia> configure!(; path=dir)

julia> isfile(joinpath(dir, "test.bson"))
false

julia> @time playback(() -> HTTP.get("https://httpbin.org/delay/5"), "test.bson");
  5.403699 seconds (51.95 k allocations: 2.944 MiB)

julia> isfile(joinpath(dir, "test.bson"))
true

julia> @time playback(() -> HTTP.get("https://httpbin.org/delay/5"), "test.bson");
  0.015231 seconds (35.24 k allocations: 1.831 MiB)

About

Reproducible tests for HTTP requests

https://juliatesting.github.io/BrokenRecord.jl

License:MIT License


Languages

Language:Julia 100.0%