Contexts |
|
|---|---|
Serve a mock API from files |
|
Turn on API mocking |
|
Make all HTTP requests raise an error |
|
Block HTTP requests |
|
Make all HTTP requests return a fake response |
|
Turn off request mocking |
|
Expectations |
|
|
|
Expectations for mocked HTTP requests |
Test that an HTTP request is made with a header |
|
Test that objects would generate equivalent JSON |
|
Recording and redacting responses |
|
Record API responses as mock files |
|
|
|
Remove sensitive content from HTTP responses |
Find and replace within a 'response' or 'request' |
|
Set a response redactor |
|
Loading mock (recorded) fixtures |
|
Set an alternate directory for mock API fixtures |
|
Set a request preprocessor |
|
Convert a request to a mock file path |
|
Return something that looks like a 'response' |
|
Vignettes |
|
Set mocking/capturing state for a vignette |
|
Handle a change of server state |
|
Other testing tools |
|
Use 'httptest' in your tests |
|
Test that functions are exported |
|
Skip tests that need an internet connection if you don't have one |
|