A Test Environment for HTTP Requests


[Up] [Top]

Documentation for package ‘httptest’ version 1.3.0

Help Pages

buildMockURL Convert a mock "URL" to a file path
capture_requests Collect API Responses as Mock Files
expect-verb Expecations for mocked HTTP requests
expect_DELETE Expecations for mocked HTTP requests
expect_GET Expecations for mocked HTTP requests
expect_header Test that an HTTP request is made with a header
expect_json_equivalent Test that objects would generate equivalent JSON
expect_no_request Expecations for mocked HTTP requests
expect_PATCH Expecations for mocked HTTP requests
expect_POST Expecations for mocked HTTP requests
expect_PUT Expecations for mocked HTTP requests
fakeResponse Return something that looks enough like an httr 'response'
public Test that functions are exported
skip_if_disconnected Skip tests that need an internet connection if you don't have one
start_capturing Collect API Responses as Mock Files
stop_capturing Collect API Responses as Mock Files
without_internet Make all HTTP requests raise an error
with_fake_HTTP Make all HTTP requests return a fake 'response' object
with_mock_API Serve a mock API from files
with_trace Wrapper around 'trace' to untrace when finished