httptest
CRANhttptestMaRDI QIDQ63594FDOQ63594
A Test Environment for HTTP Requests
Last update: 23 January 2024
Copyright license: MIT license, File License
Software version identifier: 4.1.0, 4.2.0, 1.0.0, 1.1.0, 1.2.0, 1.3.0, 2.0.0, 2.1.0, 2.1.2, 2.3.2, 2.3.4, 3.0.0, 3.1.0, 3.2.0, 3.2.2, 3.3.0, 4.0.0, 4.2.1, 4.2.2
Testing and documenting code that communicates with remote servers can be painful. Dealing with authentication, server state, and other complications can make testing seem too costly to bother with. But it doesn't need to be that hard. This package enables one to test all of the logic on the R sides of the API in your package without requiring access to the remote service. Importantly, it provides three contexts that mock the network connection in different ways, as well as testing functions to assert that HTTP requests were—or were not—made. It also allows one to safely record real API responses to use as test fixtures. The ability to save responses and load them offline also enables one to write vignettes and other dynamic documents that can be distributed without access to a live server.
Cited In (2)
This page was built for software: httptest